Solved

Have one form with two different submit destinations

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

832 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