Form validation with both PHP and Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liams
    New Member
    • Dec 2010
    • 26

    Form validation with both PHP and Javascript

    I want to validate a form, and if the form is not valid then mark it in red and display an error message next to it. This is not a problem. However, when the form does validate I have a PHP code to use the information. But the problem is, that if I validate with PHP I have to move to a new page just to display the "Form validated" message, but I want to stay on the same page. To do this, I'm thinking about using JS to validate the form, then call PHP, and when the PHP code finished, display a message on the same page, that means, it needs to be a Javascript message. But how do I coordinate JS and PHP like that?? Help will be appreciated :D

    Thanks
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    Try to understand and use AJAX.

    If you have any idea about jquery then it has very good tool to create and manage ajax request
    ajax: read the preceding link carefully.

    Comment

    • liams
      New Member
      • Dec 2010
      • 26

      #3
      That link is a true saver! thanks!

      Comment

      Working...