- Posts: 13
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript"> $(document).ready(function() { $('#answer442200X4X2S1_Cost1').val('0'); $('#answer442200X4X2S2_Cost1').val('0'); $('#answer442200X4X2S3_Cost1').val('0'); $('#answer442200X4X2S1_Cost2').val('0'); $('#answer442200X4X2S2_Cost2').val('0'); $('#answer442200X4X2S3_Cost2').val('0'); }); </script>
<script type="text/javascript"> $(document).ready(function() { if($('#answer442200X4X2S1_Cost1').val() == '') { $('#answer442200X4X2S1_Cost1').val('0'); } if($('#answer442200X4X2S2_Cost1').val() == '') { $('#answer442200X4X2S2_Cost1').val('0'); } if($('#answer442200X4X2S3_Cost1').val() == '') { $('#answer442200X4X2S3_Cost1').val('0'); } if($('#answer442200X4X2S1_Cost2').val() == '') { $('#answer442200X4X2S1_Cost2').val('0'); } if($('#answer442200X4X2S2_Cost2').val() == '') { $('#answer442200X4X2S2_Cost2').val('0'); } if($('#answer442200X4X2S3_Cost2').val() == '') { $('#answer442200X4X2S3_Cost2').val('0'); } }); </script>
<script type="text/javascript"> $(document).ready(function() { // Loop through all inputs in this question $('#question{QID} input[type="text"]').each(function(i) { if($(this).val() == '') { $(this).val('0'); } }); }); </script>