- Posts: 14405
- Thank you received: 2601
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { if('{TOKEN:ATTRIBUTE_2}' == 'réponse1') {$("input#answer65294X133X6507A1").attr('checked', true);} if('{TOKEN:ATTRIBUTE_2}' == 'réponse2') {$("input#answer65294X133X6507A2").attr('checked', true);} if('{TOKEN:ATTRIBUTE_2}' == 'réponse3') {$("input#answer65294X133X6507A3").attr('checked', true);} if('{TOKEN:ATTRIBUTE_2}' == 'réponse4') {$("input#answer65294X133X6507A4").attr('checked', true);} if('{TOKEN:ATTRIBUTE_2}' == 'réponse2') {$("input#answer65294X133X6507A5").attr('checked', true);} $("#movenextbtn,#movesubmitbtn").click(); }); </script>
Shéninmidarknico84 wrote: Sinon pour les goodies sasfépu ?
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $("#answer201410X418X5490").val('CAT10'); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $("#answer201410X418X5490").val('{TOKEN:FIRSTNAME}'); }); </script>
Valid values
(*)For single choice questions, you will see drop-down boxes letting you select the desired default.
(*)For multi choice questions, you will see check boxs letting you select the desired default state (checked or not-checked).
For text-entry questions (New in 1.92 ), you will have a text entry field in which you can enter any string or expression. If you use an expression, you need to include curly braces.
Example
You have a non-anonymous survey, where {TOKEN:ATTRIBUTE_1} is the person's age as of the time the tokens table was created. You want to prefill a question with the person's age and ask them to validate that the age is accurate, or let them change the age value if it is not accurate. In the text entry field for the default value, you would enter {TOKEN:ATTRIBUTE_1}