Sure, please find it below. There are four pages in this trial survey: The first two of them are multiple short text questions. The third and the fourth pages are to rank those multiple short text answers. As you can see, the placeholder in the third page works well without the script. However, the script in the fourth page disrupts the placeholder function. I want to have both the script and the placeholder functions at the same time eventually.
By the way: LimeSurvey 2.67.3 is from 28.07.2017, so this version is almost 3 years old, unpatched, without updates. Even within the same branch, there have been newer versions, but this branch for sure has been one of the worst branches of Limesurvey with a lot of bugs, especially at the beginning.
I would highly recommend to update to LS 3.x LTS. Currently I would not use LS 4.x in production, as it has a similar history as 2.5x, which you are using.
Help us to help you!
Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Oh, wait, it's because Expression Manager is trying to parse the inserted styles. Use this script (note the inserted spaces after the opening curly braces of the style rules):
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// Identify this question
var qID = {QID};
var thisQuestion = $('#question'+qID);
// Listeners on the rankable items
$('.ui-sortable', thisQuestion).on('sortstop', function(event, ui) {
insertRankIndicators();
});
$('.ui-sortable li', thisQuestion).on('dblclick', function(event, ui) {
setTimeout(function() {
insertRankIndicators();
}, 100);
});
// A function to insert ranking indicators
function insertRankIndicators() {
$('.inserted-rank', thisQuestion).remove();
$('.dragDropRankList li', thisQuestion).each(function(i) {
$(this).append('<span class="inserted-rank">Nr.'+(i+1)+'</span>');
});
}
// Insert some styles (these could be in template.css)
var newStyles = '.ui-sortable-handle { \
position: relative;\
}\
.ui-sortable li .inserted-rank { \
position: absolute;\
top: 5px;\
right: 5px;\
}';
$('head').append('<style type="text/css">'+newStyles+'</style>');
});
</script>