All pastes #43054 Raw Edit

Untitled

public text v1 · immutable
#43054 ·published 2006-02-24 21:43 UTC
rendered paste body

<!-- TWO STEPS TO INSTALL EMAIL VALIDATION - BASIC:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>



</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function checkEmail(myForm) {
var valid = true
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value)){
valid = true
} else {
alert("Invalid E-mail Address! Please re-enter.")
valid = false
}
if (myForm.something.value == "") {
valid = false
alert("please fill something in!")
}

return (valid)
}
//  End -->
</script>


<form onSubmit="return checkEmail(this)">
E-mail Address:
<input type="text" name="emailAddr"><br>
something:
<input type="text" name="something"><br>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>