Check out the LimeSurvey source code on GitHub!

How to change default value in array

More
5 years 11 months ago #58316 by tpartner

Can you have pieces of code for this "$(document).ready(function(){})" thing in several questions?

Another thought on this - it's not a bad idea to put all scripts in the group description anyway so they don't appear in emailed results or the data.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 11 months ago #58317 by Matherion
Ah, your code is much better indeed - thank you!

And your point re: putting scripts in the group description is a good idea. My questions tend to be pretty long already (i.e. because of explanations etc), so leaving out the code would be wise.

Thank you very much!!!

Please Log in to join the conversation.

More
5 years 11 months ago #58318 by Matherion
Yeah, cool - your code works :-)

So, do I understand correctly that if you would want the third option to be select, you'd change the '0' in
$('input.radio:eq(0)', this).attr('checked', true);
to '2'?

Please Log in to join the conversation.

More
5 years 11 months ago #58330 by tpartner
Correct - the index starts at 0 so the first element is :eq(0), the second is :eq(1), etc...

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 11 months ago #58341 by Matherion
Great, thanks!

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form