![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.javascript archiveRe: 2 button form + which button was pressed
From: RobG <rgqld@iinet.net.au>
Date: Tue Apr 04 2006 - 06:25:33 CEST
Bill_W_Stephens@yahoo.com said on 04/04/2006 1:23 PM AEST:
Change your function to be a property of an object and have the button's
> <html>
The language attribute is deprecated, remove it but keep type.
> // global var: which button I am pressing
Change to:
var chkMyForm = (function()
return {
// Do real checking based on value of btnWhichButton
},
Then in the form:
<form action="" onsubmit="chkMyForm.check()" ... >
<input type="submit" name="SubmitRecord" value="Submit Record"
<input type="submit" name="DeleteRecord" value="Delete Record"
</form>
[...]
Don't munge the action attribute, use an onsubmit attribute (see above).
[...]
> <!-- Submit Record Button -->
It's not good to use 'Submit' as a form control name, it can too easily
[...]
-- Rob Group FAQ: <URL:http://www.jibbering.com/FAQ>Received on Mon May 1 04:39:45 2006 |