submit form data in multiple buttons on a form
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > submit form data in multiple buttons on a form




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    submit form data in multiple buttons on a form  
Matt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 04:59 PM

The problem is I have 3 buttons that need to submit the form to different
URL.
My approach is to declare <input type="submit"> rather than <input
type="button">.
And put the following in the JavaScript:
InputForm.action="URL LOCATION"
InputForm.method="POST";

I think we don't need InputForm.submit(); because <input type="submit">.

Please advise and comment my approaches. Thanks!!

 ========================================
======
<html>
<head>
<script type="text/javascript">
function onClickURL1()
{  InputForm.action="url1.asp"
InputForm.method="POST";
//InputForm.submit(); //NOT NECESSARY!! because of input type="submit"??
}
function onClickURL2()
{  InputForm.action="url2.asp"
InputForm.method="POST";
//InputForm.submit(); //NOT NECESSARY!! because of input type="submit"??
}
function onClickURL3()
{  InputForm.action="url3.asp"
InputForm.method="POST";
//InputForm.submit(); //NOT NECESSARY!! because of input type="submit"??
}
</script>
</head>
<body>
<form name="InputForm">
<P><input type="text" name="username">
<P><INPUT type="submit" value="submit form data to URL1" name="action1"
onclick="onClickURL1()">
<P><INPUT type="submit" value="submit form data to URL2" name="action2"
onclick="onClickURL2()">
<P><INPUT type="submit" value="submit form data to URL3" name="action3"
onclick="onClickURL3()">
</form>
</body>
</html>







[ Post a follow-up to this message ]



    Re: submit form data in multiple buttons on a form  
Evertjan.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 06:16 PM

Matt wrote on 26 jun 2004 in microsoft.public.inetserver.asp.general:

> The problem is I have 3 buttons that need to submit the form to different
> URL.
>

This is an ASP serverside NG,

Please ask a clientside NG.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)





[ Post a follow-up to this message ]



    Re: submit form data in multiple buttons on a form  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-04 12:48 PM

Matt wrote:
> The problem is I have 3 buttons that need to submit the form to
> different URL.
> My approach is to declare <input type="submit"> rather than <input
> type="button">.
> And put the following in the Java script:
> InputForm.action="URL LOCATION"
> InputForm.method="POST";
>
Again, I don't understand what your problem is.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register