• Could this please be considered for addition in a future release.
    I couldn’t get maxlength to work – I’m not even sure what object type the fontsampler text box is!
    $('.fontsampler-id-1 > div:nth-child(1) > div:nth-child(1)').attr('maxlength','6');

    so tried this code which works but it isn’t very elegant:

    jQuery(document).ready(function( $ ){
          $("body").on("input", ".current-font", function (textevent) {
        if($(textevent.target).text().length >6) $(textevent.target).text($(textevent.target).text().substr(0,6));
      });
    });

    Many thanks

Viewing 1 replies (of 1 total)
  • Plugin Author kontur

    (@kontur)

    Hey there,

    good to see you managed a work around. Inside any .fontsampler-id-xxx element the .type-tester__content is what ultimately holds the text.

    -J

Viewing 1 replies (of 1 total)
  • The topic ‘Maximum length option for input field’ is closed to new replies.