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 ––></a><br />
<a href="../insurance.html">Back to the Insurance Section ––></a>
</h3>
</div><!-- end footer content div -->
<h4>©World Review Group</h4>
</div> <!-- end landing page content -->
<div id="blackoverlay"> </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> </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> </h3>
<p> </p>
</div>
Thanks for your help! Hopefully, this is a simple one.