Ler Ping
|
| Posted: 03/23/2002, 1:13 AM |
|
How do I use this Javascript in COdecharge Header and Footer? My form name
according to Codecharge GUI is User1, and the field name in the GUI for
Email is EmailAddress (Although I know it's actually fldEmailAddress for
field...but I'm only concerned with the input type name which si
EmailAddress, right?"
This goes into the header. Do I change the myform name into User1 ? And
emailaddr into EmailAddress?
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function checkEmail(myForm) {
if
(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value
)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
// End -->
</script>
THIS goes into the body
So how do I change the onsubmit for the form to return this? I'm already
using another javascript along with it so can the onsubmit contain two
values? (i.e. checks for two functions?)
<BODY>
<form onSubmit="return checkEmail(this)">
E-mail Address:<br>
<input type="text" name="emailAddr">
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
|
|
|
 |
|