Print Page | Close Window

Javascript confirm reset button

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5770
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript confirm reset button
Posted By: KCWebMonkey
Subject: Javascript confirm reset button
Date Posted: 15 September 2003 at 9:10pm

In my form, i want the reset button to bring up a confirm box that confirms they want to clear the form.

It needs to clear the form if they click ok, and do nothing if they click cancel.

I had the code for this before, but lost it

How do i get this done?




Replies:
Posted By: Diep-Vriezer
Date Posted: 16 September 2003 at 9:15am

 



-------------
Gone..


Posted By: KCWebMonkey
Date Posted: 16 September 2003 at 10:07am

umm... i may need a little more input than that

would i do it with something like this?

<script>
function clearConfirm() {
  If confirm('Are you sure?');
    return true;
  else
    return false;
}
</script>

<input type="reset" onClick="clearConfirm()">

I know this doesn't work, but is it going to be similar to this?



Posted By: Flamewave
Date Posted: 16 September 2003 at 11:59am
<input type="reset" onClick="return confirm('Are you sure?');">

-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: KCWebMonkey
Date Posted: 16 September 2003 at 12:30pm
Thanks. I had tried that earlier, but i guess i did it wrong...


Posted By: Diep-Vriezer
Date Posted: 16 September 2003 at 1:45pm
Lol I posted blank. Flamewave posted what I wanted to do..

-------------
Gone..



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net