Thread: Form validation
View Single Post
Old 09-24-2007, 09:05 PM   #1 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default Form validation

Hey, I'm curious, how can I check an input value and match it in the database with javascript?

Like for instance, we have a simple login form.
Input username, input password.

When they write the username nothing happens, but when they DEselect the input field of username, it instantly checks if the username exists in the database.

Code:
<form action="" method="POST">
Username: <input type="text" name="username" onblur="check('username')"><span id="nameError"></span><br />
Password: <input type="password" name="pass" onblur="check('pass')"><span id="passError"></span></form>
And it just use innerHTML to change the value of the spans.
But how do I check the values in the database with javascript? :S
Tanax is offline  
Reply With Quote