Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Have one form with two different submit destinations

Posted on 2012-03-19
3
Medium Priority
?
353 Views
Last Modified: 2012-03-19
Hello,

I have a standard form on a asp page and I need to have the option to send it to an alternate destination page. How can I do this? I've tried with a button that opens a new window but I don't know how to capture the different form values and send it to this new opened window.

Can anyone help me with this?

Thanks a lot and kind regards.

Oscar
0
Comment
Question by:starbase2
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Big Monty earned 2000 total points
ID: 37738158
just set the forms "action" attribute:

<scripr language="javascript">
    function submitData() {
         document.frmName.action = 'somePage.asp';
         document.submit();
    }
</script>

somewhere in your form, you have a button:
<input type="button" value="Save" onclick="return submitData():" />

Open in new window

0
 

Author Comment

by:starbase2
ID: 37738201
That's great. Is there anywat to open it on a new window? I know that adding target="blank" on my original form it opens on a new windows but is there a way to do it with this alternate one?

Thanks a lot.
0
 
LVL 34

Expert Comment

by:Big Monty
ID: 37738224
sure, just change the function to:

<script language="javascript">
    function submitData() {
         document.frmName.action = 'somePage.asp';
         document.target = 'blank';
         document.submit();
    }
</script>

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question