Solved

Have one form with two different submit destinations

Posted on 2012-03-19
3
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 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 33

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

Independent Software Vendors: 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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

749 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