How can I limit the characters on a drop down menu to 4 characters?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a drop down menu that allows users to input new choices if they need to. I'd like to limit the number of characters they can use to avoid users inputting confusingly long choices that makes it difficult for others to understand.


Is there a way I can do this?

Photo of Barnee

Barnee

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Xavier Fan

Xavier Fan, Champion

  • 630 Points 500 badge 2x thumb
I assume you're using a Text - Multiple Choice field.

Go to the settings for that field, go down to "Display", and set "Max characters" to 4.

When users try to add a new choice with more than 4 characters, and go to save the record, then an error message will pop up:

The data for the field "[Your text dropdown field]" is too long. (Maximum length allowed is 4 characters.)

Please enter shorter text and try again.



The record won't save until you either select an existing valid text dropdown value, and enter one that is 4 characters or shorter.



Online help for this:

Set Maximum Length for Entries in a Text Field


http://www.quickbase.com/user-assistance/Default.html#set_max_length.html
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Use the image onload technique with this one line of code:

$("#newChoice").attr("maxlength", 4);

This immediately prevents a user from entering more than four characters rather then waiting for the form to be submitted.
Photo of Barnee

Barnee

  • 0 Points
I now see that this was a silly question. I even looked for that setting and my eyes must have chosen to ignore it!

Thank you!
Photo of Barnee

Barnee

  • 0 Points
How do I add this to a 'Text - Multiple Choice' field?