lol, i didn't want the code but thank you very much, i have a code i made and i'm going to test it, but if it doesn't work out, i'll look at those tutorials, thanks
EDIT: i made a code, believe it or not, lol, from references from a javascript book i got, anyways i've come across an error, i used the javascript console on mozilla firefox and it says (when i run the script) "missing ) after condition", the line it finds the error is this: return (true) it works almost the same way as the validator does
here's the code i'm using...
<script LANGUAGE="JavaScript">
function isblank(name) {
if (name.length=0(emailform.name.value)
return (true)
}
alert("You must include your name!")
return (false)
}
function checkEmail(emailform) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailform.Email.value)){
return (true)
}
alert("Invalid E-mail Address!")
return (false)
}
</script>
<form onSubmit="return checkEmail(this)">
E-mail Address:<br>
<input type="text" name="Email">
<br>
<form onSubmit="return isblank(this)">
Your name:<br>
<input type="text" name=name>
<input type="submit" value="Send">
</form>
help and explaination is appreciated
ps. what does this line mean?
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailform.Email.value)){
i know the if and the (emailform.Email.value)){ part but i dont understand the
/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test symbols i know the code is used to decide if the email is validated or invalid but whats the *,[,],w,+ and all those characters do (the book i have doesn't go into detail about the characters, and i've haven't read through the entire book yet)
Edited by Hacker-X, 13 July 2005 - 10:37 PM.