<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I have defined some submit buttons, e.g., assoc/w
"Inquire", "Update", etc., as follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV>$cgi-> submit(-name=>"action", -value=>"Inquire"),</DIV>
<DIV>$cgi-> submit(-name=>"action",
-value=>"Update"),<BR></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>Regarding the first "if" condition in the following
JavaScript code (from the <FONT face="Times New Roman" size=3>checkForm</FONT>
function executed <FONT face="Times New Roman" size=3>-onsubmit</FONT>), the
value of " <FONT face="Times New Roman" size=3>form["action"].value</FONT>
" is <EM>undefined</EM> (. . .at least at the point in my code); however, the
value of " <FONT face="Times New Roman" size=3>form[''name"].value</FONT> "
is the value as typed in the form's <EM>Name</EM> field. </FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV>
if ( form["action"].value == "Update")
{<BR>
if ( form["name"].value == "")
{<BR>
alert("Name is
required");<BR>
return
false;<BR>
}<BR>
}<BR></DIV></BLOCKQUOTE>
<DIV dir=ltr><FONT face=Arial size=2>Obviously, the following <FONT
face="Times New Roman" size=3>-onsubmit</FONT> condition is executing the
JavaScript. In the client-side JavaScript, how do I test the value of the
clicked submit button? In other words, I need to know which submit button
was clicked.</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial
size=2></FONT><BR>$cgi->start_form(-action=>'vendors_01.pl',<BR>
-method=>'GET',<BR>
-name=>'vendors_01.pl',<BR>
-onsubmit=>"return checkForm( this );" );</DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>Thanks,<BR>Ron Wingfield</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=1>FreeBSD 4.8 -- Apache http 2.0.28 --
MySQL client/server 4.1.7<BR>Perl 5.8.5 -- p5-DBD-mysql-2.9004 driver --
p5-DBI-1.46</FONT></DIV></BODY></HTML>