• Resolved burner9000

    (@burner9000)


    add_filter( ‘woocommerce_checkout_fields’, ‘bbloomer_checkout_fields_custom_attributes’, 9999 );

    function bbloomer_checkout_fields_custom_attributes( $fields ) {
    $fields[‘Order’][‘order_wcj_checkout_field_1’][‘maxlength’] = 15;
    return $fields;
    }

    I can not work out what the array should be to set the limit on the custom field Order is not working I have also tried order_wcj_checkout_field. I have not been able to limit the characters what am I missing for this one?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support David G

    (@gravid7)

    Hi @burner9000

    Thanks for sharing the code. I am checking and will get back to you with the solution soon.

    Plugin Support David G

    (@gravid7)

    Hi @burner9000

    You can archive this by using “Custom JS” module. enable Custom JS Module and below code on “Custom JS – Front end (Customers)” field.

    jQuery(document).ready(function() {
    jQuery(“#billing_wcj_checkout_field_1”).attr(“maxlength”,”15″);
    });

    Please replace “billing_wcj_checkout_field_1” your field id. Let us know if you have further queries.

    Thread Starter burner9000

    (@burner9000)

    Hello David,

    I have done as suggested above cleared the cache and it doesn’t seem to work added to the head in the custom JS modulesettings are module enabled code copied with the ID amendment. add to header and no <script tags.

    Is there something else that I need to do

    jQuery(document).ready(function() {
    jQuery(“#order_wcj_checkout_field_1”).attr(“maxlength”,”15″);
    });

    Plugin Support David G

    (@gravid7)

    Hi @burner9000

    Thanks for your message.

    Can you try to change Custom JS module “Code Position” option to Footer? Please check and let us know if still not working.

    Thread Starter burner9000

    (@burner9000)

    Tried in both the header and the footer and still not working tuned off the caching plugin completely just to test and that didn’t work either.

    Plugin Support David G

    (@gravid7)

    Hi @burner9000

    I checked with similar code on our demo and it’s working properly. So, If possible you can contact us from our website. So, we can take a deeper look and help you.

    Plugin Support David G

    (@gravid7)

    Hi @burner9000

    I haven’t heard back from you, so I believe the issue has been resolved. I’m marking this topic complete, please feel free to open a new thread for any further queries.

    Thread Starter burner9000

    (@burner9000)

    Hello Sorry I have just seen this I will send you information

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Limit custom field checkout field length’ is closed to new replies.