hello, I have this form which has 4 fields that must not be empty on submit, I been trying to make an array that checks them.
<form action="login.php" method="post" onsubmit="return(checkAll(this))">
<label>Username<br /><input id="input[]" type="text" name="username" /></label><br />
<label>Email<br /><input id="input[]" type="text" name="email" /></label><br />
<label>Password<br /><input id="input[]" type="password" name="pswd1" /></label><br />
<label>Password Again<br /><input id="input[] "type="password" name="pswd2" /></label><br />
<input type="submit" name="submit" value="Submit" />
<input type="reset" value="Reset" />
</form>
so far i have
function checkAll(this)
{
document.getElementById("input[]")
//for loop will go here
}
to be honest not sure were to start, at this stage I need to check whether there empty and the the username/password only has a-z0-9 and the email passes a regExp test.
I know how to write individual functions to check fields/regExp but have now idea how to loop it thru an array to do both.
any help much appreciated