I don't know if Javascript is the best option for form validation, so please advise. I have one .html page, the HTML of which is located below. Basically, I need to be able to...
(1) Run a quick javascript task that will make sure that all forms have been filled in, make sure that the "Email Address" form and the "Verify Email Address" form match, as well as make sure that the "Password" form and the "Verify Password" form match.
(2) Run a php script that will write the data to a flat file.
I have the php script, and I have two separate javascript codes lined up to do the job. Only, I can't impliment them all. (This, I'm sure, has something to do with the fact that you can't have more than one onSubmit action.)
HTML Code:
<html><head></head><body>
<form onSubmit="return checkrequired(this)">
<div align="left">
<table width="600" border="0" align="left">
<tr>
<td width="226">First Name: </td>
<td width="364"><input type="text" name="requiredFirst Name"></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input type="text" name="requiredlast name"></td>
</tr>
<tr>
<td>Email (This will be your username):</td>
<td><input type="text" name="requiredemail"></td>
</tr>
<tr>
<td>Verify Email </td>
<td><input type="text" name="requiredVerify Email"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="requiredpassword"></td>
</tr>
<tr>
<td>Repeat your Password:</td>
<td><input name="requiredrepeatpassword" type="password" id="requiredrepeatpassword"> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<input name="submit" type=submit value="Submit">
</p>
</div>
</form>
</body></html>
By the way, I'm new to these forums, and I thank you for being around! I have been messing around with HTML for around six years. My largest dilemma has always been that I do not have Javascript abilities... Now that I'm finally stepping into the future by dabbling with PHP, I'm having a blast with interactivity! If I could only get it to work. Java has always frustrated me, as it never seems logical, and I've never successfully designed my own script.
Thank you,
Andrew
|