Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #21437

Re: Reset not working when I use addEventListener

Newsgroups comp.lang.javascript
Subject Re: Reset not working when I use addEventListener
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <l2112k$cqv$1@dont-email.me>
Date 2013-09-26 12:39 +0200
Message-ID <XnsA24780B092BD2eejj99@194.109.133.133> (permalink)

Show all headers | View raw


Tony Johansson wrote on 26 sep 2013 in comp.lang.javascript:
[..]
> But this doesn't work. 

===============================
<form>
  <input>
  <input type="reset" value="Reset me" onclick="return showReset();">
</form>

<script type="text/javascript">
  function showReset() {
    return confirm("Do you really want to reset the form?");
  };
</script>
===============================

This works fine here, tested on Chrome. 
Perhaps you were not showing your real test code.
[please cleare all unnecessary elements of your code, 
when showing it here.]

> When I click the reset button in the form the 
> anonymous function is called returning true if I click OK or false if I 
> click cancel.

What "anonymous" function?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Reset not working when I use addEventListener "Tony Johansson" <johansson.andersson@telia.com> - 2013-09-26 12:08 +0200
  Re: Reset not working when I use addEventListener "Tony Johansson" <johansson.andersson@telia.com> - 2013-09-26 12:17 +0200
    Re: Reset not working when I use addEventListener "Tony Johansson" <johansson.andersson@telia.com> - 2013-09-26 12:34 +0200
  Re: Reset not working when I use addEventListener "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-09-26 12:39 +0200
  Re: Reset not working when I use addEventListener Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-26 20:47 +0200

csiph-web