Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member Tyler Smith's Avatar
    Join Date
    Oct 2011
    Posts
    115
    Member #
    29767
    Liked
    7 times
    Hello everyone,

    On my website's home page, the e-mail submission forms work just fine, and I attempted to replicate it on my landing page, like this one. The jQuery obviously isn't executing because the top of the code isn't replacing the value of "your e-mail" to blank, like this:

    Code:
        $("#go").focus(function(){
            if ($("#go").val() == $("#go").prop('defaultValue')){
                $("#go").val('');
            }
        });
     
        $("#go").on('focus blur', function(e) {
          var v = $(this).val()
          if (e.type == "focus"){
            v = (v == "your e-mail")? "" : v;
          } else {
            v = (v == "")? "your e-mail" : v;
          }
          $(this).val(v);
        });
    The script is located in root/Scripts; whereas, in this example, the landing page is located in root/insurance/. I do see it when working in Dreamweaver though. I even tried putting the above snippet inside the HTML file, and it still didn't seem to work. I'll try that again, though.

    form markup
    HTML Code:
    <div id="bottomlink">
                    <h2><a href="../go/bestquoteshealth2.html">Get Health Insurance Quotes</a></h2>
                </div>
                <div id="lpfoot"><!-- begin footer content div -->
                    <form id="emailbox" name="form1" method="post" action="../Scripts/emailtester.php">
                        <div>
                            <label for="go">Join the Mailing List!<span></span></label>
                            <input type="text" name="go" id="go" value="your e-mail" maxlength="30" />
                            <input type="submit" value="Join" />
                        </div>
                    </form>
                    <h3>
                        <a href="../index.html">Back to the Home Page &ndash;&ndash;&gt;</a><br />
                        <a href="../insurance.html">Back to the Insurance Section &ndash;&ndash;&gt;</a>
                    </h3>
                </div><!-- end footer content div -->
                <h4>&copy;World Review Group</h4>
            </div>  <!-- end landing page content -->
                <div id="blackoverlay">&nbsp;</div>
                <div id="submissionform"> <!-- begin 2nd form markup -->
                  <form name="form2" method="post" action="../Scripts/confirmform.php">
                    <div>
                      <label for="confirmemail" class="fixedwidth">Confirm your e-mail:<span class="required">*</span></label>
                      <input type="text" name="confirmemail" id="confirmemail" value="" maxlength="30" class="inputwidth" />
                    </div>
                    <div>
                      <label for="name" class="fixedwidth">Enter your name:<span class="required">*</span></label>
                      <input type="text" name="name" id="name" value="" maxlength="25" class="inputwidth" />
                    </div>
                    <div>
                      <label for="age" class="fixedwidth">Select your age range:</label>
                      <select name="age" id="age" class="inputwidth">
                        <option selected="selected">Select an Age Range</option>
                        <option>18-35</option>
                        <option>36-55</option>
                        <option>55+</option>
                        <option>17 or younger</option>
                      </select>
                    </div>
                    <div>
                      <label for="gender" class="fixedwidth">Select your gender:</label>
                      <select name="gender" class="inputwidth" id="gender">
                        <option selected="selected">Select Gender</option>
                        <option>Male</option>
                      <option>Female</option>
                      </select>
                    </div>
                    <div>
                      <label for="country" class="fixedwidth">Select your location:<span class="required">*</span></label>
                      <select name="country" id="country" class="inputwidth">
                        <option selected="selected">Select Country</option>
                        <option>United States</option>
                        <option>United Kingdom</option>
                        <option>Canada</option>
                        <option>Australia</option>
                        <option>Russia</option>
                        <option>Brazil</option>
                        <option>Africa</option>
                        <option>Somewhere else</option>
                      </select>
                    </div>
                      <p id="spamtext">To prevent spam, please answer:<span class="required">*</span></p>
                      <label for="addition" id="math"></label>
                      <input name="addition" id="addition" value="" maxlength="3" />
                      <div id="errormessage">
                          <p>&nbsp;</p>
                      </div>
                        <label for="aicatcher" class="aicatcher">Please leave this field blank:</label>
                        <input type="text" name="aicatcher" class="aicatcher" id="aicatcher" value="" />
                    <input type="submit" value="Sign Me Up!" class="formsubmitbutton" id="finalsubmit"/>
                    <input type="reset" value="Cancel" class="formsubmitbutton" id="cancel"/>     
                  </form>
                </div>
              </div>
              <div id="successfulsubmit">
                  <h3>&nbsp;</h3>
                  <p>&nbsp;</p>
              </div>     
    Thanks for your help! Hopefully, this is a simple one.

  2.  

  3. #2
    Senior Member Tyler Smith's Avatar
    Join Date
    Oct 2011
    Posts
    115
    Member #
    29767
    Liked
    7 times
    I was missing jQuery. :smoke:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com