Reputation: 2646
I have been given some generated code which looks like so:
<form id="form1" method="post" action="https://applications.first-contact.biz/WebFormPosts/default.aspx">
<!-- Form fields -->
</form>
I can dump this on a page and successfully post the form to a third party website. What I would like now is to have control over the post back so that it does not immediately post to the third party, but instead posts back to itself which, once validated, then posts onto the third party.
Is there a way to do this or am I stuck with validating using Javascript?
A side question, are there security complications which come with posting cross domain in this manner?
Upvotes: 1
Views: 270
Reputation: 102723
Doing an auto-re-postback from Javascript seems awkward. I think a better solution is to have your server act as a proxy for the post request. Do the validation, then construct an HttpWebRequest and post it to the third party, with the same post data and user agent.
Upvotes: 1