Welcome, Guest
Username: Password: Remember me

TOPIC: displayQ and tbdispSGQA hidden input fields - do we really need them?

displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75422

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Here's a question for people who use custom JavaScript in their surveys.

In 1.91, we have the following:
(1) for each question, there is one <input type='hidden' id='displayQ'> field
(2) for each sub-question, there is one <input type'hidden' id='tbdispSGQA'>

When the question/sub-question is relevant, their value is set to 'on'; and when it is irrelevant, the value is set to ''.

None of these variables is needed or used by Expression Manager in 1.92, we I'm wondering whether they can be safely removed.

So, for each question, there are 2 or 3 input variables; so removing the displayQ and tbdispSGQA variables would reduce the number of $_POST variables by 33-50%

Pros:
(1) PHP 5.39 has a default limit of 1000 $_POST variables per input page - so if we don't remove them, we impose limits on survey size.
(2) Reducing the _POST size reduces network traffic and may avoid timeouts.

Cons:
(1) Might break existing surveys if they are using custom JavaScript that accesses those variables. However, those surveys could use the new relevanceQ and relevanceSGQA variables instead; and people heavily invested in those variables could just stick with 1.91+.

So, any strong objections to removing those variables?
The administrator has disabled public write access.

Re: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75437

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6362
  • Thank you received: 827
  • Karma: 245
TMSWhite wrote:
So, any strong objections to removing those variables?
Remove ! Remove !

Less is more ;)
The administrator has disabled public write access.

Re: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75462

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
Please contact user tpartner about it, he is our JS expert.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75515

  • c_schmitz
  • c_schmitz's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 789
  • Thank you received: 113
  • Karma: 92
I am for removing these.
Support us, too. Donate to the LimeSurvey project and help keep us going!
The administrator has disabled public write access.

Re: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75516

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
Me too.
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: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75530

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
OK - doing that.

One related question - What about the variables that have name='javaSGQA'? They mostly contain duplicates of the values in the inputs with name='SGQA' (which are usually the ones that are submitted, and processed to store the values in the database). Unfortunately, there is not

I'd like to remove the name='javaSGQA' attribute so that those values don't get POSTed. The input elements would stay (they are needed for JavaScript), and the IDs would remain (so that you can access those input fields via $('#javaSGQA'), but only SGQA and not javaSGQA values would be submitted.

The Pros of this is that it would ensure only one POST variable per sub-question, instead of 2.

Do you see any problems with (or have concerns about) this strategy?
The administrator has disabled public write access.

Re: displayQ and tbdispSGQA hidden input fields - do we really need them? 2 years 7 months ago #75538

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
Personally, I never use the name attributes but do quite often search for elements with an ID starting with a "java" string.

Eg.
$('#question'+q1ID+' li[id^="java"]:visible input.checkbox').attr('checked', true);
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.119 seconds
Donation Image