I wrote a function to make sure that all fields are set before the information is submitted. Unfortunately the submit button does nothing and ie says there are errors on the page.
and the form
Im thinking i just did something stupid. Any help would be appreciated, im completely new to writing javascript..
Code:
<script language=javascript>
function checkform()
{
if (document.createuser.Name.value=="")
{
alert ("Name Field is Blank");
}
else
{
if (document.createuser.Email.value=="")
{
alert ("Email Field is Blank");
}
}
else
{
if (document.createuser.Password.value=="")
{
alert ("Password is Required to Create a User");
}
}
else
{
document.createuser.action="create_check.php";
document.createuser.method="post";
document.createuser.submit();
}
}
</script>
and the form
Code:
<form name="createuser">
<TD>Full Name:</TD>
<td><input type="text" name="Name" size="24" maxlength="24"></TD>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="Email" size="24" maxlength="24">@email.com</td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="Password" size="8" maxlength="8"></td>
</tr>
<tr>
<td></tr><td><input type="checkbox" name="admin_check">Admin Rights?</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="button" class="submit" value="Create" onclick="javascript:checkform();">
</tr>
</form>
Im thinking i just did something stupid. Any help would be appreciated, im completely new to writing javascript..