Jump to content

AndreaSunshine

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

AndreaSunshine's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for the "cleaner" code. I will try it! Thanks for taking the time to write it out for me! To the main issue, it still doesn't work. It wants to move to the next page >even< when it returns a "false" value. The error message will appear but as when the user clicks "ok," it automatically takes them to the next page (pAddEmail_BallardSocial_1_validate.php). What it >should< do is stay there and let them re-enter their email address with a valid format. Then test it and if it's valid, then take them to the next page. Hope that makes sense! Andrea
  2. Hi there! I am using: a form in HTML, PHP and then I was trying to use Javascript to validate the email address before it was sent to the next PHP page. The problem is... that even if the email is invalid and the javascript function displays an error message, the page >still< proceeds to the next PHP page (as if everything was fine). However, I >want< it to stay on the same page and allow the user to enter in their email address again (correctly). And not advance to the next PHP page >until< the email address has been successfully validated. Below is my HTML, PHP and Javascript. Could anyone kindly tell me what I'm doing wrong? I'd really appreciate it! Thank you very much!! Andrea ================ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Ballard Social</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> </HEAD> <BODY BGCOLOR="#ddeae7"> <!---------------------- Sign Up on Email List ----------------------> <P> </P><P> </P><P> </P> <table BORDER="1" ALIGN="CENTER" cellpadding="10" CELLSPACING="0" BORDERCOLOR="#bfc2c1" BGCOLOR="white"> <tr><td WIDTH="355"> <FORM onsubmit='return pValidateForm()' ACTION="pAddEmail_BallardSocial_1_validate.php" METHOD="POST" name='myForm' id='myForm' > <P ALIGN="center"> <STRONG><font color="#4c4f4e" face="arial,verdana" size=2>Sign Up on the Email List</STRONG><BR> <font size=1>You will be notified of the next Ballard Social event</font><BR> <INPUT TYPE="Hidden" NAME="SourcePage" VALUE="SignUp.htm"> <INPUT NAME="Email" TYPE="text" size=28 placeholder="enter your email address"> <INPUT NAME="OK2" TYPE="submit" value="OK"></P> </FORM> </td></tr></table> </BODY> </HTML> <script language='javascript'> function pValidateForm() { var x=document.forms['myForm']['Email'].value; var atpos=x.indexOf('@'); var dotpos=x.lastIndexOf('.'); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert('Not a valid e-mail address'); return false; } } </script>
  3. Hi there, I am a fairly beginner PHP programmer. I want to make an interactive web site. I was considering using: Zend, CakePHP or CodeIgniter. But I'm not sure which one is the easiest to use. Could someone give me their opinion? I would really appreciate it! Thank you very much! Andrea
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.