rekuyki
05-26-2004, 08:34 AM
hello everyone,
right now i am haveing a problem with my function validation to check my form. i just wantit to check the email to make sure there is something in there and it contains an @ sign. Here is my code
function validate()
{
searchString = document.subscribe.Email.value;
result = searchString.search("@");
if (result == -1) {
alert("You must enter a valid email address. Please try again.");
document.subscribe.Email.focus();
return false;
</SCRIPT>
that is in the head and for the form the code is as follows
<FORM NAME="subscribe" onSubmit="return validate();"
ACTION="http://dev.myloadspring.com/chris' test/process_new_subscriber.asp" METHOD="POST">
<IMG SRC="images/subscribe.gif">
<P>Enter your email address to subscribe to our quarterly news letter</P>
<INPUT TYPE="TEXT" NAME="Email" SIZE="25">
<BR>
<Input type="SUBMIT" VALUE="Submit">
your help will be greatly appreciated
right now i am haveing a problem with my function validation to check my form. i just wantit to check the email to make sure there is something in there and it contains an @ sign. Here is my code
function validate()
{
searchString = document.subscribe.Email.value;
result = searchString.search("@");
if (result == -1) {
alert("You must enter a valid email address. Please try again.");
document.subscribe.Email.focus();
return false;
</SCRIPT>
that is in the head and for the form the code is as follows
<FORM NAME="subscribe" onSubmit="return validate();"
ACTION="http://dev.myloadspring.com/chris' test/process_new_subscriber.asp" METHOD="POST">
<IMG SRC="images/subscribe.gif">
<P>Enter your email address to subscribe to our quarterly news letter</P>
<INPUT TYPE="TEXT" NAME="Email" SIZE="25">
<BR>
<Input type="SUBMIT" VALUE="Submit">
your help will be greatly appreciated