{"id":340,"date":"2021-01-21T09:39:07","date_gmt":"2021-01-21T14:39:07","guid":{"rendered":"http:\/\/www.joonim.org\/?p=340"},"modified":"2021-01-21T09:39:07","modified_gmt":"2021-01-21T14:39:07","slug":"qualtrics-how-to-limit-input-text-box-size","status":"publish","type":"post","link":"https:\/\/waterloobae.com\/blog\/2021\/01\/21\/qualtrics-how-to-limit-input-text-box-size\/","title":{"rendered":"[Qualtrics] How to limit input text box size"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It is possible to limit the size of text box by setting &#8220;maxlength&#8221; attribute of input text box JavaScript is used for this purpose to be precise it is jQuery script.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">jQuery can be inserted for each question by clicking gear shape icon.  It will give you the option for &#8220;Add JavaScript&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The code below will limit the text box size to 10.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">jQuery(\"#\"+this.questionId+\" .InputText\").each(function () { \n   jQuery(this).attr('maxlength','10');\n});<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">There also is another place you can add JavaScript for a whole survey. Structure wise, one Survey is  handled as one web page for Qualtrics. You can navigate from your survey to &#8220;Look &amp; Feel&#8221;. Then, click &#8220;edit&#8221; under &#8220;Header&#8221;. It will bring you editor windows. You have to click source icon &#8220;&lt;&gt;&#8221; to add JavaScript here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is possible to limit the size of text box by setting &#8220;maxlength&#8221; attribute of input text box JavaScript is used for this purpose to be precise it is jQuery script. jQuery can be inserted for each question by clicking gear shape icon. It will give you the option for &#8220;Add JavaScript&#8221;. The code below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-340","post","type-post","status-publish","format-standard","hentry","category-it-tips"],"_links":{"self":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":0,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"wp:attachment":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}