Welcome, Guest
Username: Password: Remember me

TOPIC: punch multi sub-questions using for loop

punch multi sub-questions using for loop 1 year 5 months ago #95489

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7

File Attachment:

File Name: code.txt
File Size: 2 KB

I want to punch the products based upon the brands selected . Right now my CODE 1 is working fine but this is not a good way to do this.I want to do it using code 1 (using loop).Can someone please help me why it is not working.I spent several hours but no success. please help.

brands question id is B.
array Brands has brands sub-questions codes.

I have attached my code because it is not reflecting properly here.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Last Edit: 1 year 5 months ago by trivender.
The administrator has disabled public write access.

punch multi sub-questions using for loop 1 year 5 months ago #95491

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
The loop won't work because everything inside the Expression Manager curly braces is parsed at the server level so cannot contain JavaScript variables.
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.

punch multi sub-questions using for loop 1 year 5 months ago #95495

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
Tony thank you very much...

I also tried ((B_1.NAOK == "Y")) but no success. This condition works fine in relevance field . Can you please help me how can I use it in for loop.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
The administrator has disabled public write access.

punch multi sub-questions using for loop 1 year 5 months ago #95544

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
Well, as I said, I don't think you can do this using Expression Manager and a loop. The "Brands" and "Products" arrays don't exist when the expression is parsed so the loop cannot work.

I think you'll have to do it the hard way.
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.
Moderators: ITEd
Time to create page: 0.111 seconds
Donation Image