You are here: irt.org | FAQ | JavaScript | Form | 7.2 | Q265 [ previous next ]
<SCRIPT LANGUAGE="JavaScript"><!-- var button = 0; function test(val) { button = val; } function check() { alert('Button ' + button + ' pressed'); } //--></SCRIPT> <FORM onSubmit="check()"> <INPUT TYPE="SUBMIT" NAME="xxxx" VALUE="Button 1" onClick="test('1')"> <INPUT TYPE="SUBMIT" NAME="xxxx" VALUE="Button 2" onClick="test('2')"> </FORM>