View Single Post
Old 12-12-2012, 09:34 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
To redirect to the same page just needs a small change to the PHP. Either the validation of the form is done in the same page as the form with the form action pointing to the current page and a header location call redirects to the next page if the form is valid OR if the validation is done on a different page then it just needs a header location call to redirect back to the form if the validation falis - before outputting anything from the new page.

Once you get the page working correctly without JavaScript you can then make it easier for your visitors who have Javascript enabled by adding field validations to the form with JavaScript (eg. http://javascriptexample.net/domform15.php ) while still knowing that the form will function correctly without JavaScript.

jQuery is just a huge JavaScript library that provides lots of common JavaScript functionality. There is no great benefit in using it for form validation unless you are using a significant part of it for other purposes.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote