- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Limit char in 'Other' textfield
- mimi
- Topic Author
- Offline
- New Member
Less
More
11 years 1 month ago #91478
by mimi
Limit char in 'Other' textfield was created by mimi
hello...
i want to know if whether i can limit char in 'other/lain-lain' textfield.
here i'd attached too the pic of my design
i want to know if whether i can limit char in 'other/lain-lain' textfield.
here i'd attached too the pic of my design
Attachments:
The topic has been locked.
- KRav
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 5
11 years 1 month ago #91503
by KRav
research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..
Contact
Professional LimeSurvey support
info@researchonBLOGS.de
Replied by KRav on topic Aw: Limit char in 'Other' textfield
Hi,
I would use a JQuery plugin/function for this.
Cheers Kai
I would use a JQuery plugin/function for this.
Cheers Kai
research on BLOGS - Professional LimeSurvey support
Consultant - Templates - Training - JQuery magic - Support - Coding - Survey creation and more..
Contact
Professional LimeSurvey support
info@researchonBLOGS.de
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
11 years 1 month ago #91516
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 Aw: Limit char in 'Other' textfield
If you want to do it for a single question, add this to the question source:
If you want to do it for all questions in the survey, add this to the end of template.js (this example is for the multiple options question type):
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input[type="text"][id$="other"]').attr('maxlength', 10); }); </script>
If you want to do it for all questions in the survey, add this to the end of template.js (this example is for the multiple options question type):
Code:
$(document).ready(function(){ $('.multiple-opt input[type="text"][id$="other"]').attr('maxlength', 10); });
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- mimi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 1 month ago #91589
by mimi
Replied by mimi on topic Limit char in 'Other' textfield
Thank You s0 much for helping Mr.
The topic has been locked.
- mimi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 1 month ago #91596
by mimi
Replied by mimi on topic Limit char in 'Other' textfield
Okay... that is for multiple option. but how if the type is List (flexible labels)(dropdown)
tQ
tQ
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
11 years 1 month ago #91631
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 Limit char in 'Other' textfield
Of course, it would be too much to expect consistency in the IDs :laugh:
Code:
$(document).ready(function(){ $('.list-dropdown input[type="text"][id^="othertext"]').attr('maxlength', 10); });
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.