http://stackoverflow.com/questions/6347433/form-will-not-submit-if-remove-is-used
I was using ASP.NET button as using the submit behavior. I removed the asp.net button and replace it with a plain old html input button and it worked great!
Here is some sample code:
Input Button:
<input type="button" name="btnPayment" value="Checkout" onclick="update();" id="btnPayment">
Javascript:
function update() {
if ($("#uType").val() == "US") {
$("#__EVENTVALIDATION").remove();
$("#__VIEWSTATE").remove();
$("#__PREVIOUSPAGE").remove();
$("#__EVENTARGUMENT").remove();
$("#__EVENTTARGET").remove();
$elements = $('input[id^="ctl00_SubContentPlaceHolder_"]').remove();
$('form').get(0).action = "https://xxx.com/payment";
$('form').get(0).submit();
}
}
Hope that helps!!!
No comments:
Post a Comment