Welcome to the LimeSurvey Community Forum

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

how to prefill 0 for Array(Numbers)

  • xiaomeng0603
  • xiaomeng0603's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 8 months ago #217064 by xiaomeng0603
how to prefill 0 for Array(Numbers) was created 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 KB

   

File Attachment:

File Name: limesurvey...ill0.lsq
File Size:10 KB
 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #217076 by tpartner
Replied by tpartner on topic how to prefill 0 for Array(Numbers)
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: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose