Welcome, Guest
Username: Password: Remember me

TOPIC: passthrough list(radio) answer conflicts with jquery-1.7.1.min.js

passthrough list(radio) answer conflicts with jquery-1.7.1.min.js 6 months 4 days ago #106349

  • boyan
  • boyan's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Thank you received: 9
  • Karma: 1
Hi, there

I have used the following jQuery code to successfully set the default value of a list(radio) question based on the passthrough value. However, after I added <script src="code.jquery.com/jquery-1.7.1.min.js"></script> before the following code, the default value was no longer set. Any hint? Thanks!


<script type="text/javascript" charset="utf-8">
//The code is put in the help box
var passStr = "{INSERTANS:527775X3X21}";
var passNum = passStr.replace(/<\/?[^>]+(>|$)/g, "");
if (passNum != null) {
var qID = {QID};
$('#question'+qID+' input.radio:eq('+passNum+')').click();
}
</script>
Attachments:
The administrator has disabled public write access.

passthrough list(radio) answer conflicts with jquery-1.7.1.min.js 6 months 3 days ago #106356

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4190
  • Thank you received: 787
  • Karma: 359
Why would you add that? jQuery is already included.
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.

passthrough list(radio) answer conflicts with jquery-1.7.1.min.js 6 months 3 days ago #106374

  • boyan
  • boyan's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Thank you received: 9
  • Karma: 1
I was trying to implement Ajax to do autosuggestion based on a MySQL table directly rather than the csv table approach presented in the workarounds documentation, which requires jquery-1.7.1.min.js. Without it, the autosuggestion wouldn't work.

BTW, I have solved the problem by using the following simple JavaScript line:

document.getElementById("answer548129X1X" + passGrouping).checked = true;
Last Edit: 6 months 3 days ago by boyan.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.097 seconds
Donation Image