Magento – Magento custom option text field max length

magento-1.9

Previously when it was specified, Magento used to honor the max character length for custom input fields, so if I set that to two characters (for initials), it would not let the customer type in more than two characters.

Now I see that even though the note underneath the text field still says maximum two characters allowed, I can type in as many characters as I want. Anyone know how to troubleshoot such problem, I checked my browsers console and see no JavaScript errors being thrown there, any help is welcome.

Thanks in advance!

Best Answer

Default magento not provide character limit while typing in custom option text box so we can use jquey using below code

$(document).ready(function() { $(".product-options input").attr('maxlength','3'); });

you need set character limit. Replace 3 with your character limit number.

i hope it will be helpful for you !!

Related Topic