ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Is Maxlength required for a Text Input field?

October 22, 2013 6:24am

Subscribe [2]
  • #1 / Oct 22, 2013 6:24am

    Rick Lecoat

    128 posts

    The Text Input field type always comes with a default MaxLength value of 128. Not being a MySQL guy by any stretch of the imagination, my question is: is a maximum length required? And can I set it to ‘no limit’ by putting a zero in that box? (The docs are unhelpful in this regard, simply informing us that “Additional options will appear depending on the chosen field type” and then saying nothing at all about them).

  • #2 / Oct 23, 2013 3:03pm

    Rob Allen

    3114 posts

    It’s probably limited by the MySQL field type, I’m not an expert so someone may chime in with the actual limit.

    IMHO a Text input field is really best used where you don’t need long pieces of text content. I’ve set it to around 300 chars before with no problem but if I need more, or the amount of text is unknown, then I always use a Textarea field with no formatting options.

  • #3 / Oct 23, 2013 6:36pm

    Rick Lecoat

    128 posts

    Hi Rob. Yeah, I thought it would be MySQL-governed. I agree about the short bits of text a dice; in this case I was dealing with some very long URIs and wanted to make sure I didn’t clip them off. I don’t expect they would be more than 128-ish characters but I think I’ll set it to 256 just in case. Still curious as to whether entering a 0 (or leaving the box blank) would equate to ‘no limit’.

  • #4 / Oct 24, 2013 7:31am

    Rob Allen

    3114 posts

    256 chars should be fine, you could probably fit 1000 chars into a Text field 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases