Submit button's value disappears onClick
I have a simple form that takes in a user's e-mail address (the form appears when "E-mail" link clicked on). Everything appear开发者_高级运维s to function correctly, except that the value for the submit button disappears onClick or onSubmit. I can't seem to track down the issue. Please reference here. This issue only appears to affect IE. I'd prefer not to show PHP processing - but if necessary I'll show what I can. Basically, just wondering if anyone can spot any syntax errors that might be causing this, or if anyone has a solution.
Form:
<div id="formContainer">
<form action="http://www.example.com/catalog/scripts/email.php" method="post" id="contactForm">
<input type="text" name="email" value="E-mail Address" id="email" style="padding-left:5px; font:bold 11px Arial;"/>
<input type="text" name="last" value="" id="last" />
<input type="hidden" name="id" value="'.$_GET['id'].'">
<input type="submit" value="Submit" id="contactSubmit"/>
</form>
</div>
JS:
<script>
$(document).ready(function() {var options = {target: '#alert'};
$('#contactForm').ajaxForm(options); });
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form')
return $(':input',this).clearForm();
if (type == 'text' || type == 'password' || tag == 'textarea')
this.value = '';
else if (type == 'checkbox' || type == 'radio')
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
});
};
</script>
精彩评论