Welcome to the LimeSurvey Community Forum

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

how to prefill 0 for Array(Numbers)

More
5 years 3 months ago #217064 by xiaomeng0603
Hi I want to autofill the number of "0 " for this array(numbers)Could you help me to implement this functionThanks. 

File Attachment:

File Name: limesurvey...ill0.lsq
File Size:10.14 KB

   

File Attachment:

File Name: limesurvey...ill0.lsq
File Size:10.14 KB
 
The topic has been locked.
More
5 years 3 months ago #217076 by tpartner
Try this script in the question source:

Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Default 0 $('#question{QID} :text.form-control').each(function(i) { if($(this).val() == '') { $(this).val(0).trigger('keyup'); } }); }); </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: xiaomeng0603
The topic has been locked.
Moderators: holch, tpartner

Lime-years ahead

Online-surveys for every purse and purpose