javascript - Auto submit is not working with form post to centinel -
i having problem posting form sentinel payment gateway. code below working fine if place submit button on form , user has click post action url. want post automatically after 2 second delay, code not work. have checked action url correctly set in both cases. can point doing wrong here?
@model mvcapplication1.models.cartauthenticatemodel @{ layout = "~/views/shared/blanklayout.cshtml"; } type="text/javascript"></script> <form id="frmlaunchacs" name="frmlaunchacs" method="post" action="@model.centinel_acsurl"> <br> <br> <div style="text-align: center; margin: 20px;"> <h3>please wait...while redirecting payment gateway</h3> <input type=hidden name="pareq" value="@model.centinelpayload"/> <input type=hidden name="termurl" value="@model.centineltermurl"/> <input type="hidden" name="md" value="@model.centinel_transactionid"/> <input id="submit-form" type="submit" /> </div> </form> <script type="text/javascript"> window.onload = function() { var auto = settimeout(function() { autorefresh(); }, 100); function submitform() { document.forms["frmlaunchacs"].submit(); } function autorefresh() { cleartimeout(auto); auto = settimeout(function() { submitform(); autorefresh(); }, 2000); } } </script>
Comments
Post a Comment