Number range validation for "allow text entry" text box

OI899OI899 DenverCommunity Member Qubie ✭

Number range validation for "allow text entry" text box

Hi I am looking to require numbers 0-30 only in a text entry box, in a multiple choice question.

I would use a text entry question type, but I need to have two other options available (refused, don't know).

I couldn't use custom validation (regex 0-30) because that required something be entered, when the respondent could select one of the other two options.

I guess more generally, how can I add radio choices (refused, don't know) to questions of other types (e.g. text entry, matrix, ect.)

Best Answer

  • [Deleted User][Deleted User] Qubie ✭
    Accepted Answer

    Try using below regex:

    \b([1-9]|[12][0-9]|3[0])\b

    will I use regex code to indicate "if first option is selected, then check the regex"? - No, you need to use

    option 1 is not selected
    OR
    option 1 text entry matches regex.

Answers

  • Hello @OI899 ,

    You can use regex, in custom validation you need to check if first option is selected then only check the regex

  • OI899OI899 DenverCommunity Member Qubie ✭

    Thanks very much- can you help me with the regex code?

    And to clarify- will I use regex code to indicate "if first option is selected, then check the regex"?

Sign In to Comment