Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Form Post Action options

Reply
Thread Tools

Form Post Action options

 
 
SMXSteve
Guest
Posts: n/a
 
      11-07-2005
I have a form with several submit buttons. Each one is different. For
instance, one may require the next action window to be a pop up requesting
more data. Another may require it to be normal. And of course I need the
request data from the form.

I tried not specifying the action on the form and put it on the the submit
button via the OnClick but the request data was always behind and isn't
current until after the submit.

I guess an easy way to think about it is say you have a tool bar and
depending on which button you click it fires a different asp file but the
current form data.

Hope this makes sense.

Thanks
 
Reply With Quote
 
 
 
 
SMXSteve
Guest
Posts: n/a
 
      11-07-2005
As things go I found a solution.
Call a script that actually sets the action to the specific file.

Something like

document.myformname.action="page.asp"




"SMXSteve" wrote:

> I have a form with several submit buttons. Each one is different. For
> instance, one may require the next action window to be a pop up requesting
> more data. Another may require it to be normal. And of course I need the
> request data from the form.
>
> I tried not specifying the action on the form and put it on the the submit
> button via the OnClick but the request data was always behind and isn't
> current until after the submit.
>
> I guess an easy way to think about it is say you have a tool bar and
> depending on which button you click it fires a different asp file but the
> current form data.
>
> Hope this makes sense.
>
> Thanks

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      11-07-2005
You can name all the submit buttons the same and then see which one was
clicked. Just make sure you handle users who press enter or Ctrl+M to
submit the form.

<input type="submit" name="cmdSubmit" value="Action 1">
<input type="submit" name="cmdSubmit" value="Action 2">
<input type="submit" name="cmdSubmit" value="Action 3">

<%

Select Case Request.Form("cmdSubmit")
Case "Action 1" ''' do stuff
Case "Action 2" ''' do stuff
Case "Action 3" ''' do stuff
Case Else ''do other stuff
End Select
%>

Ray at work

"SMXSteve" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a form with several submit buttons. Each one is different. For
> instance, one may require the next action window to be a pop up requesting
> more data. Another may require it to be normal. And of course I need the
> request data from the form.
>
> I tried not specifying the action on the form and put it on the the submit
> button via the OnClick but the request data was always behind and isn't
> current until after the submit.
>
> I guess an easy way to think about it is say you have a tool bar and
> depending on which button you click it fires a different asp file but the
> current form data.
>
> Hope this makes sense.
>
> Thanks



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts: 1 action, 1 Form, several views handled by 1 only action. Any idea for better design? John Java 0 06-26-2007 11:22 PM
form post action Brad ASP .Net 0 12-27-2006 08:22 AM
post form to new window; preserve original form action property Bosconian Javascript 4 12-03-2006 07:47 PM
<FORM METHOD="post" onSubmit="return fieldcheck()" name="orientation" action="http://ws-kitty.BU.edu/AT/survey/orientation/script/write.asp" language="JavaScript"> Joeyej ASP .Net 0 06-04-2004 07:55 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments