Form Post Action options

S

SMXSteve

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
 
S

SMXSteve

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"
 
R

Ray Costanzo [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top