I think you should just be able to do: function areYouSure() { if(confirm("Are you sure?")) { form.submit(); return true; } else { return false; } }
and then in your code do something like <input type="radio" name="request" value="declined" onClick="return areYouSure(this);"> I haven't had a chance to test it, but give that a shot. Hope this helps, Dave. ----Original Message Follows---- From: Kim Ahlbrandt <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: CF-Talk <[EMAIL PROTECTED]> Subject: javascript in template...help Date: 24 Jan 2002 11:15:46 -0800 Ok, I have used up all options...no one I know can help me (or feels like helping me)with the absolutely easiest javascript question there is. I have coded this in the past...but am rusty. It is the absolutely most frustrating problem I've ever had. I simply want to put up a confirm box when the user clicks a radio button. The box should say "Are you sure you want to decline this loan?" then when they click cancel, it will close the window (and I'd like it to also change the radio button but that may be asking too much). When they click "OK", it should submit the form. So easy..but I just can't do it. Here is my latest version (and there have been many many versions over the past two days). function areYouSure(form) { confirm("Are you sure?"); if return.true { form.submit(); } } And, in the form: <INPUT type="radio" name="request" value="declined" onClick="areYouSure()"> You can laugh, but please don't be too mean. I don't know what is wrong with me and why I can't even find this on the web!! This is a coldfusion template...sorry it's just a javascript question. If possible, write me at [EMAIL PROTECTED] I can wait for the digest but I may have throw my computer out the window by then. Thanks, Kim 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 _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com ______________________________________________________________________ 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