- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Autocomplete of array text fields
- nagim
- Topic Author
- Offline
- New Member
Less
More
9 years 4 months ago #115357
by nagim
Autocomplete of array text fields was created by nagim
Hi,
I used the jQuery autocomplete function with success for free text and multiple short text questions (described here):
I tried to switch the question type for Array (Texts), but it's not working anymore on the array text fields.
Code is here:
Any suggestions how to modify the code to work on array text fields?
Thanks in advance!
I used the jQuery autocomplete function with success for free text and multiple short text questions (described here):
I tried to switch the question type for Array (Texts), but it's not working anymore on the array text fields.
Code is here:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var q1ID = '121580'; var toollist = "tool1,tool2".split(','); $('#question'+q1ID+' input.text').autocomplete({ source: toollist, minLength: 0, scroll: true }).focus(function() { $(this).autocomplete("search", $(this).val()); }); }); </script>
Any suggestions how to modify the code to work on array text fields?
Thanks in advance!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 4 months ago #115383
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Autocomplete of array text fields
Hmm...there doesn't seem to be a "text" class applied to those input elements.
Try changing this:
To this:
Try changing this:
Code:
$('#question'+q1ID+' input.text').autocomplete({
To this:
Code:
$('#question'+q1ID+' input[type="text"]').autocomplete({
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: nagim
The topic has been locked.
- nagim
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
9 years 4 months ago #115385
by nagim
Replied by nagim on topic Autocomplete of array text fields
You're spot on!
It works fine with array (text) as well!
Thanks very much!
It works fine with array (text) as well!
Thanks very much!
The topic has been locked.
- sabrina_g
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
8 years 9 months ago #122036
by sabrina_g
Replied by sabrina_g on topic Autocomplete of array text fields
Hi tpartner!
I'm trying to use this java to autocomplete an array text, but it doesn't work, i can't find out why. I've read a lot of previus posts but can't fixed it .
Can you help me with this please?
Thank you!!
I put the code below:
<script charset="utf-8" type="text/javascript">
$(document).ready(function() {
// Identify the question
var q1ID = '{QID}';
var q1 = $('#question'+q1ID+' input[type="text"]').autocomplete({
//var url = 'http://localhost/limesurvey2/upload/templates/Apertura_BDO/nombres.csv';
var url = '{TEMPLATEURL}nombres.csv';
var countries = new Array();
});
});
});
</script>
I'm trying to use this java to autocomplete an array text, but it doesn't work, i can't find out why. I've read a lot of previus posts but can't fixed it .
Can you help me with this please?
Thank you!!
I put the code below:
<script charset="utf-8" type="text/javascript">
$(document).ready(function() {
// Identify the question
var q1ID = '{QID}';
var q1 = $('#question'+q1ID+' input[type="text"]').autocomplete({
//var url = 'http://localhost/limesurvey2/upload/templates/Apertura_BDO/nombres.csv';
var url = '{TEMPLATEURL}nombres.csv';
var countries = new Array();
});
});
});
</script>
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
8 years 9 months ago - 8 years 9 months ago #122128
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Autocomplete of array text fields
I don't see that you have applied the autocomplete plugin. Please review the complete workaround:
- manual.limesurvey.org/Workarounds:_Manip...1_and_later_versions
- manual.limesurvey.org/Workarounds:_Manip...r_LimeSurvey_2.05.2B
- manual.limesurvey.org/Workarounds:_Manip...1_and_later_versions
- manual.limesurvey.org/Workarounds:_Manip...r_LimeSurvey_2.05.2B
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 9 months ago by tpartner.
The topic has been locked.