Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Array Filter works badly in IE6

Array Filter works badly in IE6 6 years 2 weeks ago #52586

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5441
  • Thank you received: 813
  • Karma: 240
jessego wrote:
The survey was planned to go live tomorrow. It seems I have to put it off :dry:

In your survey, are both questions on the same page?

If yes, what happens if you put them on different pages? Because if it is true what Shnolle says, and the Array Filter is implemented via PHP for questions that are on different pages, then this could be a solution. Because with PHP there shouldn't occur any browser related problem.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52607

  • jessego
  • jessego's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
In your survey, are both questions on the same page?

Yes, and different pages' implementation is OK.

So, javascript problem maybe.
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52611

  • jessego
  • jessego's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Finally, i've found where the problem is and got a solution.

1.Problem: low-quality javascript code

If the related questions are in the same page, LS implements array filter with javascript.

Click on the checkbox(or radio) triggers the function called checkconditions
function checkconditions(value, name, type)

My question has 26 options, and there are 26X2 if-else blocks in the checkconditions().

The code of if-else block like this:
if ((document.getElementById('java78256X82X324611') != null && document.getElementById('java78256X82X324611').value == 'Y'))
	{
		document.getElementById('javatbd78256X82X325011').style.display='';
		document.getElementById('tbdisp78256X82X325011').value = 'on';
	}
	else
	{
		document.getElementById('javatbd78256X82X325011').style.display='none';
		document.getElementById('tbdisp78256X82X325011').value = 'off';
		$('#javatbd78256X82X325011 input[type=text]').val('');
		$('#javatbd78256X82X325011 input[type=checkbox]').attr('checked', false); 	}

It means when I single click the checkbox, I have to run 52 blocks of code.
And there are 2 jQuery sentences in each else block!!!

jQuery has bad performance in IE6, as u know.

So that's the problem.


2.My solution:
I don't have enough time and I only replace the jQuery code with the normal javascript sentences.

I modified "group.php" (latest version)

Near Line 910, I declare a variable to save the id of the hidden answer(may be a checkbox, text or radio type)
//@author Jesse(jiexi.zha@gmail.com)
$answerid = "answer".$qbase.$fansrows['title'];

Near Line 940
// This line resets the text fields in the hidden row
$appendj .= "\t\t$('#$tbody input[type=text]').val('');\n";
// This line resets any radio group in the hidden row
$appendj .= "\t\t$('#$tbody input[type=checkbox]').attr('checked', false); ";

changed to
// Modified By Jesse (jiexi.zha@gmail.com)
// Abandon the jQuery Implementation. Because IE6 sucks.
$appendj .= "\t\t inputtype = document.getElementById('$answerid').type;\n";
// This line resets the text fields in the hidden row
// $appendj .= "\t\t$('#$tbody input[type=text]').val('');";
$appendj .= "\t\tif(inputtype == 'text') document.getElementById('$answerid').value = '';\n";
// This line resets any radio group in the hidden row
// $appendj .= "\t\t$('#$tbody input[type=checkbox]').attr('checked', false); ";
$appendj .= "\t\tdocument.getElementById('$answerid').checked = false;\n";

Near Line 963, 1028, 1060
// This line resets the text fields in the hidden row
$appendj .= "\t\t$('#$tbody input[type=text]').val('');";
// This line resets any radio group in the hidden row
$appendj .= "\t\t$('#$tbody input[type=radio]').attr('checked', false); ";

changed to
// Modified By Jesse (jiexi.zha@gmail.com)
// Abandon the jQuery Implementation. Because IE6 sucks.
$appendj .= "\t\t inputtype = document.getElementById('$answerid').type;\n";
// This line resets the text fields in the hidden row
// $appendj .= "\t\t$('#$tbody input[type=text]').val('');";
$appendj .= "\t\tif(inputtype == 'text') document.getElementById('$answerid').value = '';\n";
// This line resets any radio group in the hidden row
// $appendj .= "\t\t$('#$tbody input[type=radio]').attr('checked', false); ";
$appendj .= "\t\tdocument.getElementById('$answerid').checked = false;\n";

That really improve the performance in IE6.
I hope someone would rewrite the javascript function and give us a better solution.

holch and Shnoulle, thanks a lot!
Last Edit: 6 years 2 weeks ago by jessego.
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52621

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9586
  • Thank you received: 1375
  • Karma: 390
jessego wrote:
That really improve the performance in IE6.
I hope someone would rewrite the javascript function and give us a better solution.
![/quote]

I think it's great if you can put the patch on bug report system. If you can , do the patch for limesurvey-dev version.

bug report: bugs.limesurvey.org/
Dev version : docs.limesurvey.org/tiki-index.php?page=...meSurvey+development

It can be great :)


PS: holch: alinks is a pure text based on lynx . No javascript at all , and no CSS too. Then you can't do something.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52627

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Thanks for having such a detailed look at it. To forward your findings to our developer, please open a ticket at our Bugtracker as Shnoulle has suggested.

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

Array Filter works badly in IE6 6 years 2 weeks ago #52629

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5441
  • Thank you received: 813
  • Karma: 240
jessego wrote:
holch and Shnoulle, thanks a lot!

No problem! And as Shnoulle and Mazi said: it would be great if you could submit your improvements, so that it could be implemented in Limesurvey. This would help others as well. And you won't have to bother when it comes to updates of Limesurvey.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52633

  • jessego
  • jessego's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
I think it's great if you can put the patch on bug report system.

ok, i'll do that :cheer:
The administrator has disabled public write access.

Array Filter works badly in IE6 6 years 2 weeks ago #52643

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Great, please post the link here afterwards.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.506 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form