Connecting Tech Pros Worldwide Forums | Help | Site Map

Form validation using javascript in php application

Newbie
 
Join Date: Aug 2007
Posts: 9
#1: Aug 22 '07
Dear Sir,

Hello ! I need to validate my login form which is displayed using <div> to give sliding effect and not to refresh page, hence can't use generic php submit but to validate using javascript and/or ajax. And in log in form I need to validata user id and password to my mysql database.

Please guide me.

Thanks & Regards,

Naimesh Trivedi



pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#2: Aug 22 '07

re: Form validation using javascript in php application


Heya, Naimesh.

JavaScript validation is not a catch-all, as the results can be spoofed. JavaScript validation is useful, as it prevents the bulk of invalid info from ever reaching your server, plus your Users get instantaneous feedback on their input. However, you should still also be doing your validation on the server for security reasons.

To get started with JavaScript validation, check out this tutorial.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: Aug 22 '07

re: Form validation using javascript in php application


What code do you have so far?

See an AJAX POST example. Post your data to the PHP script which will validate the user login.
Reply


Similar JavaScript / Ajax / DHTML bytes