TransWikia.com

Magento custom option text field max length

Magento Asked by K.I on January 19, 2021

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!

One 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 !!

Answered by Mukesh Prajapati on January 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP