[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

submit two forms

hi all

I would like to submit a html form in silent mode whenever user click a button.
i.e.
  step 1: submit a html form silently, screen remain unchange but request has been
              passed to server side
  step 2: after step 1 is completed, submit another html form, with screen change
             (ie. forward to result screen)

How to achieve it? Pls suggest.

Thanks/GLOGIN
0
glogin
Asked:
glogin
1 Solution
 
BatalfCommented:
You can achieve it by implementing an hidden iframe which is the target of your first form

example:

<form action="aPage.html" target="myIframe" method="post">


and the iframe

<iframe name="myIframe" style="display:none"></iframe>

Then from aPage.html, post the other form by javascript when the first form is finished it's submission.

example:

<script type="text/javascript">
parent.document.formNameNumber2.submit();
</script>

Batalf
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now