Hey guys,
This is a JavaScript issue inside of my PHP modules. It's not a module issue however because testing outside of module produces the same results. I hope you do mind me asking for assistance but I find this community to be superior to any other.
The issue is when this code is fired off the alert pops up, the focus is set to the form field but instead of sitting there awaiting for the user to enter information and resubmit the form the action fires off as true and for testing takes the user to yahoo.com.
This is simple stuff but I can't for the live of me figure out what is wrong. I don't understand how it could be false and with not change still be true? Any help would be greatly appreciated.
Simple javascript.
<script language="javascript">
function check_password_length()
{
if (document.update_password.password1.value == "")
{
alert ("Please enter a password.");
document.update_password.password1.focus()
return false;
}
return true;
}
</script>
The html form
<form name="update_password" method="get" action="http://www.yahoo.com" onSubmit="check_password_length();">
<input type="text" name="password1" id="password1" />
<input type="submit" name="button" id="button" value="Submit" />
</form>