How to POST to form with redirect

I have been trying to do this for hours now but no luck.

I have an application page in which there is a form. When user clicks Submit button, form values are submitted to an external site where user enters his credit card number etc. and complete transaction.

I am trying to submit this form with POST to that external site but it is not working.

If I make this form runat=server then I get error because SharePoint automatically adds its own form in page so now we have two server side forms.

I tried using Javascript submit methods like

this.form.submit()

window.document.myform.submit()

document.getElementById("myform").submit()

document.getElementById["myform"].submit()

but I get javascript error that this method "submit" is not available.

I have seen countless examples on internet and they all seem to create a form at run time and submit it using client side method for e.g. this.form.submit() which doesn't work in my case.

Is there any way to do this?

September 12th, 2015 10:21am

I fixed it by creating a new page in the middle. I pass values to this page and then this page submits the form. Since this new page is not part of master page, hence I can use my own form and submit it to external site.
Free Windows Admin Tool Kit Click here and download it now
September 12th, 2015 2:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics