Welcome, Guest
Username: Password: Remember me

TOPIC: Add a reset button to clear textbox input

Add a reset button to clear textbox input 2 years 2 months ago #101695

  • boyan
  • boyan's Avatar
  • Offline
  • Senior Lime
  • Posts: 49
  • Thank you received: 9
  • Karma: 1
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>
The administrator has disabled public write access.

Add a reset button to clear textbox input 2 years 2 months ago #101712

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1588
  • Thank you received: 390
  • Karma: 102
Hi,

A big part of your required code is probably here.
BenoƮt
The administrator has disabled public write access.
The following user(s) said Thank You: boyan

Add a reset button to clear textbox input 2 years 2 months ago #101714

  • boyan
  • boyan's Avatar
  • Offline
  • Senior Lime
  • Posts: 49
  • Thank you received: 9
  • Karma: 1
problem solved. I think I could not use reset which might be a reserved word. After changing reset to formreset, it worked perfectly.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.245 seconds