I am trying to replace a form div with a message which is working, but for some reason it's stopped the onsubmit from working in the form, so the message is displayed but the form hasn't submit.
Here is the Form:
<div id="domsearch" class="grid_4 right" style="padding-left:20px;padding-top:30px;">
<form action='/dac' id="dac" onsubmit="return check_domain_input()" accept-charset='utf-8'>
<input name="domain" class="searchdom" value="www." onclick="this.value=''"/>
<input type="submit" class="grey-big-button-submit" id="search" name="search" value="search"/>
</form></div>
And here is the JS to swap the DIV:
$("#dac").submit(function (event) {
$("#domsearch").slideUp("slow", function () {
$(this).replaceWith("<div id='loading' style='float:right;'>" +
"<h2>Please be patient while" +
"we check availability. <img src='/images/progress.gif'/></h2>" +
"" +
"</div>");
$("#loading").delay(8000).slideUp("slow", function () {
$(this).replaceWith("<div id='results' style='float:right;'>" +
"<h2>Almost There...</h2>" +
"</div>");
});
})
event.preventDefault();
});
Any ideas where I've gone wrong?
Aucun commentaire:
Enregistrer un commentaire