- Posts: 915
- Thank you received: 218
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
- Topic Author
- Offline
- Platinum Member
Less
More
7 years 7 months ago #141127
by lfanfoni
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
Problems with a javascript on dropdownlist combined was created 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
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.
- steve_81
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 37
7 years 7 months ago #141139
by steve_81
Replied by steve_81 on topic Problems with a javascript on dropdownlist combined
Hi,
could you please provide a .lss export of the question.
It's difficukt to debug without it.
Greets
Steve
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
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 218
7 years 7 months ago #141140
by lfanfoni
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
Replied by lfanfoni on topic Problems with a javascript on dropdownlist combined
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.
- steve_81
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 37
7 years 7 months ago #141154
by steve_81
Replied by steve_81 on topic Problems with a javascript on dropdownlist combined
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:
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:
Hopefully it works.
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(...
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
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 218
7 years 7 months ago #141172
by lfanfoni
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
Replied by lfanfoni on topic Problems with a javascript on dropdownlist combined
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.