The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1

THEMA: Limit char in 'Other' textfield

Limit char in 'Other' textfield 4 Monate 2 Tage her #91478

  • mimi
  • mimis Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 28
  • Karma: 0
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:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Aw: Limit char in 'Other' textfield 4 Monate 2 Tage her #91503

  • ResearchOnBlogs
  • ResearchOnBlogss Avatar
  • OFFLINE
  • Gold Lime
  • Beiträge: 171
  • Dank erhalten: 16
  • Karma: 8
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 gegen Spambots geschützt! JavaScript muss aktiviert werden, damit sie angezeigt werden kann.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Aw: Limit char in 'Other' textfield 4 Monate 2 Tage her #91516

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2869
  • Dank erhalten: 428
  • Karma: 246
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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Limit char in 'Other' textfield 4 Monate 2 Tage her #91589

  • mimi
  • mimis Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 28
  • Karma: 0
Thank You s0 much for helping Mr.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Limit char in 'Other' textfield 4 Monate 1 Tag her #91596

  • mimi
  • mimis Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 28
  • Karma: 0
Okay... that is for multiple option. but how if the type is List (flexible labels)(dropdown)

tQ
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Limit char in 'Other' textfield 4 Monate 1 Tag her #91631

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2869
  • Dank erhalten: 428
  • Karma: 246
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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
Moderatoren: DenisChenu, ITEd
Ladezeit der Seite: 0.270 Sekunden
Donation Image