Limit char in 'Other' textfield

Mehr
4 Jahre 2 Monate her #91478 von 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
Anhang:

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #91503 von KRav
Hi,
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
Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #91516 von tpartner
If you want to do it for a single question, add this to the question source:
<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):
$(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.

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #91589 von mimi
Thank You s0 much for helping Mr.

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #91596 von mimi
Okay... that is for multiple option. but how if the type is List (flexible labels)(dropdown)

tQ

Bitte Anmelden um der Konversation beizutretten.

Mehr
4 Jahre 2 Monate her #91631 von tpartner
Of course, it would be too much to expect consistency in the IDs :laugh:
$(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.

Bitte Anmelden um der Konversation beizutretten.