The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Changing the maxlength attribute in the checkout form fields


I saw this on the changes for v2.0: "Updating checkout address templates to include maxlength values."

and I see the attribute in the fields maxlength="50" for example in the "shipping_first_name" field.

is there a way I can modify this value? I've searched the forums and the documentation but couldn't find anything on how to do this.

  • fc_marijafc_marija FoxyCart Team
    Hi @alextorres -

    Thanks for reaching out! The change for v2.0 restricts the maxlength values to coincide with our database value lengths, so unfortunately, it can't be changed.

    Please let us know if you have any additional questions.


  • Hello @marija

    my intention was to lower the maxlength to 30, so the database value lengths wouldn't be a problem. But I'm guessing it's still not possible.

    Thank you for the answer!
  • fc_adamfc_adam FoxyCart Team

    Thanks for confirming - it is actually possible to go lower there if you want. For setting the shipping first name, you could do that with javascript added to the "footer" textarea of the "Add custom header and footer code to your templates" option. You can find that option on the "configuration" page of your store's FoxyCart administration:
    {% if context == "checkout" %}
    FC.client.on("render.done", function() {
    {% endif %}
    You can then expand on that to also then alter down other maxlength attributes as needed.
  • Hello @fc_adam,

    this does exactly what I needed, thank you
Sign In or Register to comment.