Solved

Have one form with two different submit destinations

Posted on 2012-03-19
3
338 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 32

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 32

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now