I have an ASP website and I need to add a form that will post to another site and open in another window. I can’t use JavaScript (which would make it easy). The issue is that I can only post a few fields to the other site, so I can’t just add the inputs and redirect the post back to the other site because all of the ASP info would be posted, too.
Basically, I need to get the following code working (or something equivalent), but I can’t add the form tag because of the ASP form.
<form id="frm_post" action="https://anothersite.com" target="_blank" method="POST">
<input type="hidden" id="accountnumber" name="accountnumber" value="123456" />
<input type="submit" value="Submit" />
</form>
All the fields will be hidden, so it will basically look like a link, but it will be a post request with the specified fields/values.
Thanks.
Instead of nesting the form try moving the inner form tag to be outside/after the asp.net form.
Then use CSS to reposition the 2nd form so that it looks like it is in the same position visually as it currently does.