Select to view content in your preferred language

Constraints Aren't Working For Large Text Fields

287
2
Jump to solution
09-11-2024 04:28 AM
Marc_Patti
Occasional Contributor

Hi All,

I'm trying to input a constraint on a survey form with text questions of varying field length. Basically, I want the form to throw up a message whenever the user enters a note that exceeds a certain character limit. I've managed to make this work for smaller text fields with the following line:

string-length(string(${notes43}))<256

However, when I use a similar line (outlined below) for large text boxes that can hold 1000 characters, I don't get the constraint message at all when the limit is exceeded:

string-length(string(${notes43}))<1001

Anyone know where I'm going wrong here?

[Edit]: The text fields are configured with a multiline appearance, if that matters at all. 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Did you set a longer field length in bind::esri:fieldLength column?  Just making sure.

No need to have string() in there.  I would also add a space between < and 1001 as it can confuse html at times.

So like this string-length(${notes43}) < 1001

Just a guess.

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

Did you set a longer field length in bind::esri:fieldLength column?  Just making sure.

No need to have string() in there.  I would also add a space between < and 1001 as it can confuse html at times.

So like this string-length(${notes43}) < 1001

Just a guess.

Marc_Patti
Occasional Contributor

Ooo interesting note on the field length. My original line worked on the smaller text field which did NOT have a field length set in the form, but it didn't work on the the larger text fields that did have a set field length of 1000. Not sure why that is, but it does seem related.

Regardless, your refined line did indeed work on the larger fields. Thanks so much for your help!