W3C home > Mailing lists > Public > www-talk@w3.org > March to April 1995

Distinguishing between submit buttons (SMTP Id#: 31343) -Reply

From: Matt Lewis <mwl@nrc.gov>
Date: Tue Mar 7 11:23:06 1995
Message-Id: <9503071635.AA02403@nrc.gov>
To: <www-talk@www10.w3.org>
>>>>>>>>>>>>>>>
Hi,
	Would someone know on how to distinguish between
two submit buttons 
in the same form. In my application, one of them is for
"Browse", while 
the other one is for "Submit". the CGI script has to take
different 
actions for the two. Can't put browse in a separate form as
both buttons 
need some common fields.

Thanxall
Rupesh
<<<<<<<<<<<<<<<
Use separate values in your submit button definitions, such
as:
<p><INPUT NAME="SUBMIT" TYPE="submit"
VALUE="browse"> </p>
<p><INPUT NAME="SUBMIT" TYPE="submit"
VALUE="submit"> </p>

Have your script search for the value of SUBMIT.  If it
=browse execute the appropriate script or portion of the
script.  If SUBMIT=submit, then execute the submit script or
portion of code.  

Theoretically this should work, but I have not tried it, so I can
not validate it.

--- Nuclear Regulatory Commission
| Matt Lewis                      Email: mwl@nrc.gov              |
| Network Solutions, Inc.         Phone: 301-718-1770        |
| Bethesda, MD (Washington, DC)     Fax: 301-907-3227  |
Received on Tuesday, 7 March 1995 11:27:04 UTC

This archive was generated by hypermail 2.4.0 : Monday, 20 January 2020 16:08:16 UTC