Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Problems with a javascript on dropdownlist combined

  • lfanfoni
  • lfanfoni's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 7 months ago #141127 by lfanfoni
Hi there.
I've adapted a script of Denis Chenu to define two dropdown list (italian provinces and towns).
This script run well in 2.05 version, but not in 2.50 version. You can test here the 2.50.
With firebug I've found errors on these statements:
1) answertextwidth=$(this).find("col.answertext").attr('width').replace("%","");
2) ddarrayseparatorwidth=$(this).find("col.ddarrayseparator").attr('width').replace("%","");

I hope you can assist me.
Luciano

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
More
7 years 7 months ago #141139 by steve_81
Hi,
could you please provide a .lss export of the question.
It's difficukt to debug without it.
Greets
Steve
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 7 months ago #141140 by lfanfoni
Here you can find the zip file of the question (2 MB)

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
More
7 years 7 months ago #141154 by steve_81
Hi,

sorry I was in a meeting, but here we go:

The adjusting of the width is the problem, but I can offer you a solution.
Change the script of Denis to this:
Code:
// Fix width of columns
      $(this).find("col.ddarrayseparator").attr('width',"2%");
      $(this).find("th.th-14").attr('width','50%');
      $(this).find("th.th-15").attr('width','50%');
      $("#question"+qID+" table.question tbody tr").each(...
Maybe its not as smart as the origin solution.

And a design issue: A little bit further down there is var NewSelectElement, ther you add class='form-control'. The line should look like this:
Code:
var NewSelectElement = "<select id='"+idNewSelectFilter+"' class='form-control'><option value=''>"+$("#"+idSelectFilter+" option[value='']:first").text()+"</option></select>";

Hopefully it works.
The following user(s) said Thank You: lfanfoni, mzzvtr
The topic has been locked.
  • lfanfoni
  • lfanfoni's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 7 months ago #141172 by lfanfoni
Yes! It works on 2.50 and 2.05 too. Here the 2.50.
Thanks a lot!
Luciano

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The following user(s) said Thank You: mzzvtr
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose