Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Add a reset button to clear textbox input

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

  • byan
  • byan'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 3 years 2 weeks ago #101712

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1894
  • Thank you received: 467
  • Karma: 118
Hi,

A big part of your required code is probably here.
BenoƮt

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.
The following user(s) said Thank You: byan

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

  • byan
  • byan'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.
Time to create page: 0.193 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form