Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting forms via buttons... 1

Status
Not open for further replies.

Snaggs

Programmer
Jan 11, 2000
393
US
I'm sure this is real easy to do, but I'm stuck at the moment.

I have an asp page that has a form on it. The form is defined like this:

<FORM name=&quot;records&quot; id=&quot;go&quot; action=&quot;records.asp?Mode=<%=Mode%>&quot; method=&quot;post&quot;>

I have three buttons on the form, ADD, UPDATE and DELETE.

I want to change the Mode and submit the form. OR... If I could somehow tell the button to open the records.asp page with the above querystring that would be ok too.

Thanks in advance, Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
set the action of the form to

action=&quot;records.asp&quot;


Include the 3 submit button in the form each with the same name but different values.

and on the records.asp page test the submit button for its value like

cmd = request(&quot;MySubmit.value&quot;)
select case cmd
case &quot;add&quot;
' do this
case &quot;update&quot;
' do something else
case &quot;delete&quot;
end select

 
RichS - You da Man!

Thanks, Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top