View Single Post
  #1 (permalink)  
Old 12-07-2008, 08:40 PM
AuctionHugh's Avatar
AuctionHugh AuctionHugh is offline
WebProWorld Pro
 
Join Date: Jul 2004
Location: Kalamazoo Michigan
Posts: 103
AuctionHugh RepRank 0
Question Form Validation not Working - help please?

I basically use the same form which I modify from site to site as needed - why reinvent the wheel?

This one has a lot of fields, but I am only validating three of them - name cannot be blank, email has to be an email address, and the spam catcher has to be 777.

(Note that in my form2email.php file I do more checking for valid email, same referrer, 777, etc, which really cuts down on spam - probably many discussions on this elsewhere.)

Anyway, for some reason in this incantation of the form it is allowing the form to be submitted with both the name and/or email fields blank.

It is probably something pretty obvious, but I'm missing it. I'd appreciate it if one of you experts (and I don't mean that sarcastically) could glance this over and tell me what is going on. Thanks!

edit - my form seems to be too long to submit so I'm cutting out the parts I'm not trying to validate:

HTML Code:
                  <h1 class="headings">Music Selection Form</h1>
                 <form name="MusicSelection" method="post" action="FormToEmail.php">
                  <table width="100%" border="0" cellpadding="8" cellspacing="0" class="bodytext">
                    <tr>
                      <td width="48%"><strong>Your Contact Information</strong></td>
                      <td width="52%">&nbsp;</td>
                    </tr>
                    <tr>
                      <td><div align="right">Your Name:</div></td>
                      <td width="52%"><input name="Name" type="text" class="formstyle" id="Name" size="24" maxlength="75" /></td>
                    </tr>
                    <tr>
                      <td><div align="right">Your Email:</div></td>
                      <td width="52%"><input name="email" type="text" class="formstyle" id="email" size="28" maxlength="100" /></td>
                    </tr>
                    <tr>
                      <td colspan="2"><div align="center"><em>Please note: We will not share or release<br />
                        your personal information with any other source.</em></div></td>
                      </tr>
......
                    <tr>
                      <td><div align="right"><span class="bluebold">Enter the number 777 to help us avoid spam:</span></div></td>
                      <td><input name="AvoidSpam" type="text" class="formstyle" id="AvoidSpam" tabindex="10" size="50" maxlength="3" /></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    

<td><input name="SendRequest" type="submit" class="formstyle" id="SendRequest" onClick="MM_validateForm('Name','','R','email','','RisEmail','AvoidSpam','','RinRange777:777');return document.MM_returnValue" value="Send Request">        
                      </td>
                    </tr>
                  </table>
                  </form>

Last edited by AuctionHugh; 12-07-2008 at 08:42 PM.
Reply With Quote