Setting the maximum length in bootstrap x-editable form

I need to set the maximum length for a text field in a form for bootstrap. The fact is that the text box that appears is an inline function of the form, so I could not set maxlength as an html attribute. I tried this using jquery but it doesn’t work (I can not attach a screenshot) Please help me solve this problem,

+7
source share
3 answers

You can set the HTML attributes by overwriting the template:

For example:

$('#your_id').editable({ tpl: '<textarea maxlength="250"></textarea>' }); 
+13
source

Well, you should set the maxLength attribute using jQuery, for example, as follows:

 $('#myBox').attr('maxlength', 6); 

There is additional information in this question .

But with your question, it's hard to say what you tried. Please add the jQuery code you tried to solve, so we can help you.

0
source

It looks like there is an inputclass attribute that you can pass so you can style it however you want. Overriding the tpl parameter can be hairy because user library classes are applied to it.

0
source

All Articles