Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Preview text in textfield

  • Rzwiers
  • Rzwiers's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago #156139 by Rzwiers
Preview text in textfield was created by Rzwiers
Hi all,

Is it possible to show a preview text in an answer text field as in the picture attached?

Thanks a lot!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 8 months ago #156151 by tpartner
Replied by tpartner on topic Preview text in textfield
Assuming the question type is short-text, set up your survey to use JavaScript and place the following script in the source of the question:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){  
 
    $('#question{QID} input[type="text"]').attr("placeholder", "Type your answer here");  
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Rzwiers
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose