Hi to all!
this week I tried to resolve the issue in the subject.
Referring to this old
thread
on the forum I tried to use code suggested but, in my case, it seem not working. The drop-down list is about the national italian provinces (about 110 different items).
The code I try to use is this (only first occurence):
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
if('{TOKEN:ATTRIBUTE_3}' == 'Agrigento' && $('#answer681778X1530X27648').val() == '') {
$('#answer681778X1529X27648 option').removeAttr('selected');
$('#answer681778X1529X27648 option[value="1"]').attr('selected', 'selected');
$('#answer681778X1529X27648').val('1');
}
if('{TOKEN:ATTRIBUTE_3}' == 'Alessandria' && $('#answer681778X1530X27648').val() == '') {
$('#answer681778X1529X27648 option').removeAttr('selected');
$('#answer681778X1529X27648 option[value="2"]').attr('selected', 'selected');
$('#answer681778X1529X27648').val('2');
}
...
if('{TOKEN:ATTRIBUTE_3}' == 'Vicenza' && $('#answer681778X1530X27648').val() == '') {
$('#answer681778X1529X27648 option').removeAttr('selected');
$('#answer681778X1529X27648 option[value="109"]').attr('selected', 'selected');
$('#answer681778X1529X27648').val('109');
}
if('{TOKEN:ATTRIBUTE_3}' == 'Viterbo' && $('#answer681778X1530X27648').val() == '') {
$('#answer681778X1529X27648 option').removeAttr('selected');
$('#answer681778X1529X27648 option[value="110"]').attr('selected', 'selected');
$('#answer681778X1529X27648').val('110');
}
});
</script>
Where 681778X1530X27648 is the SGQ code and the values "1", "2" etc etc are the answer code of the drop-down list.
After numerous tests I still don't understand why the code above doesn't work!
Has someone any I idea about my mistake or how to solve my issue??
Thank for help in advance.
AgoZ