Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: How to change default value in array

Re: How to change default value in array 3 years 8 months ago #58316

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4371
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: How to change default value in array 3 years 8 months ago #58317

  • Matherion
  • Matherion's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
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!!!
The administrator has disabled public write access.

Re: How to change default value in array 3 years 8 months ago #58318

  • Matherion
  • Matherion's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
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'?
The administrator has disabled public write access.

Re: How to change default value in array 3 years 8 months ago #58330

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4371
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: How to change default value in array 3 years 8 months ago #58341

  • Matherion
  • Matherion's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
Great, thanks!
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.151 seconds
Donation Image