Home : General : Internet Technologies :

General: Internet Technologies: Javascript Validation help: Edit Log

Here is the list of edits for this post
Javascript Validation help
Heya all,

I've grabbed the piece of JS from the internet. I know nada about JS so I'm hacking this together.Wink

I want to validate a specific field (email) and simply pop a warning when someone is using a hotmail account. After they close the pop-up I want the form submission to proceed as normal.

This works fine except that nothing happens after they close the pop-up. The JS was apparently written to prevent them from continuing if the function is true. How do i need to tweak this to get the form to be submitted after they read the warning?

Code:
<HEAD>

<script language="javascript">
<!--
Names = new Array(
"hotmail")
function Check() {
//Change FORM and FIELD to the form name and field name throughout this function
namechk=document.FORM.FIELD.value.toLowerCase()
awdrgy = 0
aLeRt = 0
while (awdrgy<=Names.length-1 && aLeRt!=1) {
if (namechk==Names[awdrgy]) {
aLeRt = 1
alert("You are using a Hotmail account")
document.FORM.FIELD.value=""
}
awdrgy++
}
}
-->
</script>

</HEAD>

<BODY>

<form name="FORM">
<input name="FIELD" onblur="Check();" onblur>
<input type="button" onclick=storytest() value="Submit" class="form">
</form>

Safe swoops
Sangiro

Last edited by:

sangiro: Sep 17, 2004, 4:40 AM

Edit Log: