Constraint message in Web Form persists during correct answer

4447
15
Jump to solution
11-05-2018 09:55 AM
NickDierks1
Occasional Contributor II

In a survey published as a web form, I've noticed that constraint messages for certain questions will always display, regardless of the user input provided. This applies to custom constraint messages as well as the the default "It's an invalid answer" (when the constraint_message column is left blank). The constraint itself is triggered appropriately, turning red only when an incorrect input is provided, but the message displays the entire time (even before an input is provided), no matter what.

So far, I've seen this happen with text, integer, and date fields, but not yet a select_one. This occurs in both Firefox and Internet Explorer browsers. I don't recall this happening before version 3.1, but I didn't do enough web form testing to be certain.

The fact that this behaviour is only within the web form, and even then is inconsistently applied to different question types, leads me to believe this is a bug, but I wanted to check here to make sure it's not just me. Is anyone else experiencing this? And if so, can anyone who hasn't upgraded to 3.1 test this?

0 Kudos
15 Replies
ElliottPlack1
New Contributor III

The update appears to have been completed!

Invalid:

Valid:

FinneyCountyGIS
New Contributor III

Has this been fixed? I am using version 3.7.62 and still encountering this issue. I have a calculated integer, and a constraint on that calculate to say .>0

The constraint message does not go away even after that calculation shows any integer greater than 0. The end user is still able to submit, however some users are confused and don't hit submit because it still looks like an error

0 Kudos
FinneyCountyGIS
New Contributor III

After testing, here is what i found.

I have a field "Total Points". I don't want the user to modify the total points so it is a read only field. When the user answers questions the points get totaled but the message doesn't go away. 

When I turn off read-only and type in a value the message goes away. So it seems to be a problem with the calculation not triggering the constraint to validate.

0 Kudos
TregChristopher
Occasional Contributor

My location constraint on web from is working fine. It is a read-only note field, has a calculation to sum 2 integer fields (int(${ValidX}) + int(${ValidY})), and a constraint of .=2 so it won't show the constraint message unless the calc doesn't sum to 2. Just tested the web form (https://survey123.arcgis.com/share/a384e90f69744f2e846135a9ce80027f ) and it does in fact show the constraint message and prevent the user from submitting until they correct their location.

So I think in general, constraints in web forms seems to be working as expected, since the 3.4 or 3.5 release. In my situation with a spatial constraint, ideally the constraint would be on a hidden field (instead of a note field) because the constraint message shows on form load...so a a little messy looking but it is good enough for now. 

One thought is that since you are using a note field, I think the calc needs to be cast to integer ( e.g. my calc is:int(${ValidX}) + int(${ValidY}) ), otherwise it might read the result as a string and then the constraint wouldn't fire if it is expecting your integer value of .>0

0 Kudos
FinneyCountyGIS
New Contributor III

My "Total Point" field was hidden with the bind::esri:fieldType set to esriFieldTypeInteger. However when adding the constraint to the hidden field it would still let them submit with 0 points.

So I change my "Total Point" field to an integer (not a note field) that i made read only.

My calculation for the "Total Point" field:

int(${MandatorySM_1}) + int(${VoluntarySM_1}) + int(${DeptStretching_1}) + int(${SDS_Review_2}) + int(${PPE_Inspection_2}) + int(${VehicleToolInsp_2}) + int(${Cleaning_2}) + int(${SafetySuggestion_2}) + int(${SafetyReport_2}) + int(${SafetyCommitteeMeeting_2}) + int(${DailyStandWalk_2}) + int(${PresentSafety_5}) + int(${NearMissReport_5}) + int(${SafetyImplemented_10}) 

My constraint is for the "Total Point" field:

.>0

0 Kudos
TregChristopher
Occasional Contributor

That all looks right to me...Sorry I can't think of anything else as to why yours isn't working.

And yeah, hidden constraints don't seem to work on the web form (but do in the field app). This would be a nice feature that I would love to see working in the web form.

0 Kudos