Add a reset button to clear textbox input

More
3 years 9 months ago #101695 by byan
byan created the topic: Add a reset button to clear textbox input
Dear all,

I am trying to add a reset button so that a respondent can clear textbox input and retype without leaving the survey. Here is my code but it doesn't work. Any guidance is appreciated. Thanks!

<input id="reset" onclick="reset()" type="button" value="Reset" />
<script type="text/javascript">
function reset() {
document.getElementById("answer548129X3X1241").value=" ";
document.getElementById("answer548129X3X1242").value=" ";
document.getElementById("answer548129X3X129").value=" ";
}
</script>

Please Log in to join the conversation.

More
3 years 9 months ago #101712 by Ben_V
Ben_V replied the topic: Add a reset button to clear textbox input
Hi,

A big part of your required code is probably here .

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: byan

Please Log in to join the conversation.

More
3 years 9 months ago #101714 by byan
byan replied the topic: Add a reset button to clear textbox input
problem solved. I think I could not use reset which might be a reserved word. After changing reset to formreset, it worked perfectly.

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now