Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > onclick does not work with reset?

Reply
Thread Tools

onclick does not work with reset?

 
 
chirs
Guest
Posts: n/a
 
      11-28-2003
Hi,

In a website

http://www.devguru.com/Technologies/...n_onclick.html

it says:

The following example shows the use of the onClick event handler to
offer users the chance to cancel the resetting of a from when clicking
on a Reset button.

Code:
<INPUT TYPE="RESET" onClick="return confirm('Are you sure?')">

I added an input box with this code in a form. But the reset button
always clear input box. What's wrong?
 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      11-28-2003
chirs said:
>
>Hi,
>
>In a website
>
>http://www.devguru.com/Technologies/...n_onclick.html
>
>it says:
>
>The following example shows the use of the onClick event handler to
>offer users the chance to cancel the resetting of a from when clicking
>on a Reset button.
>
>Code:
><INPUT TYPE="RESET" onClick="return confirm('Are you sure?')">
>
>I added an input box with this code in a form. But the reset button
>always clear input box. What's wrong?


Did you copy that code exactly, or did you forget the "return"?
What browser are you using for testing?

 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      11-28-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (chirs) writes:

> Code:
> <INPUT TYPE="RESET" onClick="return confirm('Are you sure?')">
>
> I added an input box with this code in a form. But the reset button
> always clear input box. What's wrong?


I expect you have a Javascript error. Turn error reporting on and tell
us what it says

A guess: Do you have any form controls, forms, or global variables
called "confirm"? If so, rename them.

/L
--
Lasse Reichstein Nielsen - (E-Mail Removed)
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
chirs
Guest
Posts: n/a
 
      11-29-2003
Lee <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> chirs said:
> >
> >Hi,
> >
> >In a website
> >
> >http://www.devguru.com/Technologies/...n_onclick.html
> >
> >it says:
> >
> >The following example shows the use of the onClick event handler to
> >offer users the chance to cancel the resetting of a from when clicking
> >on a Reset button.
> >
> >Code:
> ><INPUT TYPE="RESET" onClick="return confirm('Are you sure?')">
> >
> >I added an input box with this code in a form. But the reset button
> >always clear input box. What's wrong?

>
> Did you copy that code exactly, or did you forget the "return"?
> What browser are you using for testing?


You are right, I did not put return.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DOM onClick event (works in FF and does not work in IE) Moses Javascript 3 03-19-2007 04:08 AM
onclick event does not work with select option in IE prash.marne@gmail.com Javascript 7 01-18-2007 03:35 PM
onclick event does not work with select option in IE prash.marne@gmail.com Javascript 0 01-18-2007 07:16 AM
onclick="alert('hello');return false;" does not work in IE7? alvin.yk@gmail.com Javascript 11 12-11-2006 01:41 AM
onclick does not work with Input type=image Wayne Javascript 1 10-09-2003 05:37 PM



Advertisments