Skip navigation
strangeflower75
Currently Being Moderated

Spry Validation For PHP Form

Jul 12, 2012 10:06 AM

Tags: #spry #dreamweaver_cs5

Hello All,

 

I am currently using the Spry Validation within Dreamweaver 5.1.1 and it was working in my development environment until yesterday. I did not change directories so I believe it is not an issue with my file structure.  Below you will see my baic form set up and for some reason, when I load my page, all of the spry error messages are visable. Previously, the page would load and it would not appear until there was an error after submitting the page.  Maybe I'm missing something but an extra pair of eyes does not hurt.  The ".textfieldRequiredMsg" class displays automatically when it is set in the css file to "display: none:".

 

I'm stumped:

 

 

 

<meta http-equiv="X-UA-Compatible" content="IE=100"> <!-- IE fights me on forms -->
<title>Company Name</title>
<link rel="stylesheet" href="css/style.css" media="screen">
<!--[if IE]>
<link rel="stylesheet" href="css/ie.css" media="screen"?
<![endif] -->


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="js/jquery.placeholder.js"></script>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>


<body>


 <form action="calltoaction/contact.php" id="contact" style="margin-top: -20px;" method="post" name="contact">
        
                  <div class="row">
                    
                        <div class="left"><span id="sprytextfield1">
                        <input id="name" placeholder="Name" type="text" name="Name" autofocus required>
                        <span class="textfieldRequiredMsg">A value is required.</span></span></div>   
                        
                         <div class="left">
                           <input id="pharmacyname" placeholder="Pharmacy Name" type="text" name="BusinessName" required>
                        </div>                
                      
                        
                   </div>
          
          <div class="row">
          
          <div class="left">
            <input id="telephone" placeholder="Please provide your contact number" name="Phone" required>
           </div>
          
          <div class="left">
          <input id="email" placeholder="Email Address" name="Email" required>
         </div>
          
          </div>
          
          <div class="row">
                    
                        <div class="left">
                        
                            <div class="styledselect">
                              <select style="width:400px; color: #898888; height: 42px;" tabindex="2" name="Subject" id="Subject">
                                <option value="select">What can we help you with? Click to select an option.</option>
                                <option value="website comments">New Website Comments</option>
                                <option value="ordering">Ordering</option>
                                <option value="order status">Order Status</option>
                                <option value="csos">CSOS Setup</option>
                                <option value="payments credits">Payments &amp; Credits</option>
                                <option value="contact account manager">Contact My Account Manager</option>
                                <option value="email list">Join Email List</option>
                                <option value="monthly newsletter">Sign Up For Monthly Newsletter</option>
                                <option value="rewards">Auburn REWARDS Free Goods</option>
                                <option value="reset password">Reset User ID/Password</option>
                                <option value="questions">Questions</option>
                                <option value="suggestions">Suggestions</option>
                                <option value="other">Other (Please Specify)</option>
                              </select>
                            </div> 
                            <!-- end select style-->
            </div>
          </div>
          
          <div class="commentbox">
                              <div class="left">
                                <textarea id="styled" placeholder="Please type your message here" name="Comments" required></textarea>
                                 </div>
          </div>
          <div class="row">
                              <div class="left">
                              <input type="image" src="images/contact_submit.png" name="submit" width="85" height="38" id="submitbutton">
            </div>
                     
          </div>
                  
                   <div class="row">
                    <div class="left required"><em>*All fields are required.</em></div>
                    
          </div>
        
        </form>

<script>
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["change"]});
</script>

</body>
</html>


 
Replies
  • Currently Being Moderated
    Jul 13, 2012 12:44 AM   in reply to strangeflower75

    Withe the exception of a missing DOCTYPE declaration, an opening <html> and <head> tag, I see no problem with your code.

     

    The only part that could make a difference is the call to jquery.placeholder.js. Try commenting this out and see what happens.

     

    Gramps

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points