problem with ajax post
Posted
by zurna
on Stack Overflow
See other posts from Stack Overflow
or by zurna
Published on 2010-03-14T21:33:27Z
Indexed on
2010/03/14
21:35 UTC
Read the original article
Hit count: 329
jQuery
For some weird reason, the codes below are first working, then website is redirecting to the url. I used this code many times before without any problems, please please advise!
Test page: http://www.refinethetaste.com/FLPM/?Section=myaccount&SubSection=signup
<script type="text/javascript">
$(document).ready(function() {
$("[name='submit']").click(function() {
$.ajax({
type: "POST",
data: $(".form-signup").serialize(),
url: "http://www.refinethetaste.com/FLPM/content/myaccount/signup.cs.asp?Process=Add2Member",
success: function(output) {
$('.form-signup').html(output)
},
error: function(output) {
$('.form-signup').html(output);
}
});
});
});
</script>
<form method="post" action="http://www.refinethetaste.com/FLPM/content/myaccount/signup.cs.asp?Process=Add2Member" class="form-signup">
<div class="clearfix">
<label for="MembersFullName">Full Name *:</label>
<div class="username form-height">
<input id="modlgn_username" type="text" name="MembersFullName" value="" class="inputbox" size="18" />
</div>
<label for="MembersEmailAddress">Email Address *:</label>
<div class="username form-height">
<input id="modlgn_username" type="text" name="MembersEmailAddress" value="" class="inputbox" size="18" />
</div>
<label for="MembersPassword">Password *:</label>
<div class="password form-height">
<input id="modlgn_passwd" type="password" name="MembersPassword" class="inputbox" size="18" />
</div>
<label for="MembersPasswordc">Password (confirm) *:</label>
<div class="password form-height">
<input id="modlgn_passwd" type="password" name="MembersPasswordc" class="inputbox" size="18" />
</div>
<div id="inputs">
<input type="checkbox" name="agree" class="checkbox" value="1" />
<label for="agree" class="agree">I agree to User Agreement and Privacy Policy.</label>
</div>
<div class="clear">
<input type="submit" name="submit" class="button-login png" value="Sign Up" />
</div>
</div>
<div id="form-login-remember">
<div class="form-indent-top">
<span class="login-text-1">Already Have Account?</span>
<a href="?Section=myaccount&SubSection=signin"> Sign In</a>
</div>
</div>
</form>
© Stack Overflow or respective owner