- Posts: 23
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Define the names var names = ['Store 1', 'Store 2', 'Store 3', 'Store 4', 'Store 5', 'Store 6']; // Randomize the names shuffleArray(names); // Load the <input> element with the random name $('#question{QID} input[type="text"]').val(names[0]); }); function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } </script>[/i][/i]
Please Log in to join the conversation.
Your LimeSurvey version: [2.73.3-1]
Own server or LimeSurvey hosting: hosted
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
// Load the <input> element with the random name $('#question{QID} input[type="text"]:eq(0)').val(names[0]); $('#question{QID} input[type="text"]:eq(1)').val(names[1]);
Please Log in to join the conversation.