How to determine what button was pushed? --(@@@)
Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmit=return OnSubmit(); input type=submit name=btnAction id=btnAction value=Move input type=submit name=btnAction id=btnAction value=Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 It is better to be hated for what you are than to be loved for what you are not. -- Andre Gide __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How to determine what button was pushed? --(@@@)
I don't have a solution for ya, but I use Google Groups for all my JavaScript issues...it's great! Bryan Stevenson VP Director of E-Commerce Development Electric Edge Systems Group Inc. p. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Original Message - From: Troy Simpson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 2:33 PM Subject: How to determine what button was pushed? --(@@@) Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmit=return OnSubmit(); input type=submit name=btnAction id=btnAction value=Move input type=submit name=btnAction id=btnAction value=Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 It is better to be hated for what you are than to be loved for what you are not. -- Andre Gide __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How to determine what button was pushed? --(@@@)
One other thing I needed to add. In IE, if a user presses the Enter Button, the page gets submitted but no default button is pressed. How has others resolved this issue? I am thinking that I am going to have to assumed a default action if the Enter Key has been pressed and a button on the form was not. Thanks, Troy Troy Simpson wrote: Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmi= return OnSubmit(); input type=submit name=btnAction id=btnAction valu= Move input type=submit name=btnAction id=btnAction valu= Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 It is better to be hated for what you are than to be loved for what you are not. -- Andre Gide __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: How to determine what button was pushed? --(@@@)
go right to the source. http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm Another good site is www.irt.org , and I second groups.google.com Look for event handlers like onkeypress/up/down and the like. When doing this I usually load a function via onload that is included like a library. Alexander Sicular Chief Technology Architect Neurological Institute of New York Columbia University as867 [at] columbia {dot} edu |-Original Message- |From: Troy Simpson [mailto:[EMAIL PROTECTED]] |Sent: Wednesday, January 23, 2002 5:34 PM |To: CF-Talk |Subject: How to determine what button was pushed? --(@@@) | | |Is there a way to use client-side javascript to determine what |button was pushed before submitting a form? | |For example: | |form action=page.cfm method=get or post name=frm |onsubmit=return OnSubmit(); | input type=submit name=btnAction id=btnAction |value=Move | | input type=submit name=btnAction id=btnAction |value=Copy | |/form | |Thanks, |Troy | |P.S. Anyone know of a good JavaScript list to subscribe to? | |-- |Troy Simpson | North Carolina State University |NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina |ph.919.515.3855 | fax.919.513.3330 | |It is better to be hated for what you are |than to be loved for what you are not. | -- Andre Gide | | __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How to determine what button was pushed? --(@@@)
Why not try this instead: form action=page.cfm method=get or post name=frm input type=button name=btnAction id=btnAction value=Move onClick=OnSubmit(); input type=button name=btnAction id=btnAction value=Copy onClick=OnSubmit(); /form - Original Message - From: Troy Simpson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 4:33 PM Subject: How to determine what button was pushed? --(@@@) Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmit=return OnSubmit(); input type=submit name=btnAction id=btnAction value=Move input type=submit name=btnAction id=btnAction value=Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 It is better to be hated for what you are than to be loved for what you are not. -- Andre Gide __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How to determine what button was pushed? --(@@@)
Here is one way... script language=JavaScript submitForm(btn) { alert(btn.name + ' was clicked.'); document.frm.submit(); } /script form action=page.cfm method=post name=frm input type=button name=btnActionMove id=btnActionMove value=Move onclick=submitFOrm(this) input type=button name=btnActionCopy id=btnActionCopy value=Copy onclick=submitFOrm(this) /form http://groups.yahoo.com/group/JS-Jive/ jon ps. I was going to make a pro Tarheel joke, but they suck right now, so I wont bother ;-) - Original Message - From: Troy Simpson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 5:33 PM Subject: How to determine what button was pushed? --(@@@) Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmit=return OnSubmit(); input type=submit name=btnAction id=btnAction value=Move input type=submit name=btnAction id=btnAction value=Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: How to determine what button was pushed? --(@@@)
I came up with this, it tells the form to click on the button when you submit the form. Also the onclick function of the buttons tells the javascript which button was pressed. Not sure if this is what you want or not. script language=JavaScript function getName(btnid){ window.alert (btnid.value); } /script form name=frm onSubmit=this.submit.click() input type=text name=blah input type=submit name=submit value=Submit onclick=getName(this) input type=button name=cancel value=Cancel onclick=getName(this) /form __ steve oliver cresco technologies, inc. http://www.crescotech.com -Original Message- From: Troy Simpson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 5:41 PM To: CF-Talk Subject: Re: How to determine what button was pushed? --(@@@) One other thing I needed to add. In IE, if a user presses the Enter Button, the page gets submitted but no default button is pressed. How has others resolved this issue? I am thinking that I am going to have to assumed a default action if the Enter Key has been pressed and a button on the form was not. Thanks, Troy Troy Simpson wrote: Is there a way to use client-side javascript to determine what button was pushed before submitting a form? For example: form action=page.cfm method=get or post name=frm onsubmi= return OnSubmit(); input type=submit name=btnAction id=btnAction valu= Move input type=submit name=btnAction id=btnAction valu= Copy /form Thanks, Troy P.S. Anyone know of a good JavaScript list to subscribe to? -- Troy Simpson | North Carolina State University NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina ph.919.515.3855 | fax.919.513.3330 It is better to be hated for what you are than to be loved for what you are not. -- Andre Gide __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists