I have a survey where users regularly need to type "less than one foot" in a text question. Most of them abbreviate this phrase as "<1'". I have a new user who was trying to abbreviate as "<FT" and found that he could not submit his surveys. It would return error code 10583, "A value passed for the field 'notes' is invalid."
I did some searching for that error code, which was how I narrowed it down to being an issue with the < specifically. After some more testing, it turns out (and in retrospect I am not surprised by this) that < followed immediately by any letter except b, i , o, p, s, or u will result in the same failure. If there is a space between the < and the letter, the survey sends successfully, and it is also successful followed by any non-alphabetic character.
Since the default behavior of text questions is to allow the interpretation of a subset of HTML tags in them, this makes sense. I've made use of that functionality in other surveys to display formatted messages to users.
What's frustrating is that when the <+letter combination does not match with one of the supported HTML tags, the survey fails to send instead of just treating the <+letter as a string.
I can use regex in the constraint column to give my users a warning if they have an angle bracket next to an alphabetic character, but what I'd really like to do is tell Survey123 to treat the input of the question as a string literal, and not attempt to interpret any part of it as HTML. I have not found any documentation suggesting this is possible, but I was wondering if anyone knows of an option like this for S123? Thanks!
Just a couple ideas off the top of my head...
Don't give users a free form text entry. Use a selection question type instead, with a dropdown or radio button, or similar. Stop the problem before it occurs.
Use the calculation or format field to separate the '<' from any immediately following character.
Add a hint instructing users not to do this.
The only free form text questions I use are comments. Don't underestimate the ways users can get around 'foolproof'. I used to have users enter their usernames manually, and one guy entered at least 14 different variations of his username.
The problem with fool proofing something is that they always build a better fool.
I agree though, make them use a button or a choice. You could also do it as a select_multiple question and just have a single choice "less than 1 foot", it will show up as a check box (which my brain likes more than a single choice radio button)
What is being added in that field the times when it is not "< 1 ft"? If it is a measurement, and a select_one or select_multiple doesn't work for the rest of your scenario. You could look at constraining the entries, by making the field type an "integer" or "decimal" type with a input mask, and have a separate box for "< 1 ft" scenario as @TylerGraham2 suggests.