# ODKX: Constaint / warnings - avoiding hard stops

**URL:** <https://forum.odk-x.org/t/odkx-constaint-warnings-avoiding-hard-stops/589>\
**Category:** Support\
**Created:** [November 22, 2019, 9:22am UTC](https://forum.odk-x.org/t/odkx-constaint-warnings-avoiding-hard-stops/589 "2019-11-22T09:22:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.odk-x.org/u/Andreas)\
**Post date:** [November 22, 2019, 9:22am UTC](https://forum.odk-x.org/t/odkx-constaint-warnings-avoiding-hard-stops/589/1 "2019-11-22T09:22:55Z")

</div>

Hi all

I was wondering if anybody know of a clever (and preferably) easy method of implementing warnings / soft stops in a survey?

My current method is using a custom alert-prompt which calls a js alert() function, eg:  
begin screen  
some statement  
end screen  
if some statement is not true  
alert(‘The error’)  
goto ‘previous screen’  
end if  
A session variable makes sure the alert()-prompt only activates 1 time.  
The method works, but it has some problems:

- If the promt is activated, the survey do not jump directly to ‘previous screen’, only when ‘next’ is pressed the goto clause is activated.
- I would like to implement quite a few soft stops, and this method is a bit ‘clumsy’.

Any advice?

---

<div class="post-metadata">

**Author:** ![elmps2018](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/elmps2018/32/105_2.png) [@elmps2018](https://forum.odk-x.org/u/elmps2018)\
**Post date:** [November 22, 2019, 2:34pm UTC](https://forum.odk-x.org/t/odkx-constaint-warnings-avoiding-hard-stops/589/2 "2019-11-22T14:34:06Z")

</div>

Hi @Andreas!

The constraint column can be used for hard stops, or the required column (if the constraint is that you need to answer), but it sounds like you only want soft stops and warning messages.

I don’t think there’s an easy way to go to another screen without pressing next – that is how you generally navigate along. You probably can achieve the same thing without a custom prompt just using if statements, notes with the warning, and then using section navigation or goto. The controller options are documented here: [ODK-X Survey Controller Actions — ODK-X Docs](https://docs.opendatakit.org/odk-x/survey-controller-actions/?highlight=goto)

If you can describe a bit more about what you are trying to do with this and why that might help us think of other options.

---

<div class="post-metadata">

**Author:** ![jules\_rugwiro](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jules\_rugwiro](https://forum.odk-x.org/u/jules_rugwiro)\
**Post date:** [November 23, 2019, 10:31pm UTC](https://forum.odk-x.org/t/odkx-constaint-warnings-avoiding-hard-stops/589/3 "2019-11-23T22:31:02Z")

</div>

Hello @Andreas,

I personally wouldn’t allow enumerators to skip with any critical errors on screen … but that’s different to your current needs I guess…

To achieve what you described (assuming I got it correct) go to form management settings

 ![Screenshot_20191123-232220_ODK%20Collect](https://odkx.b-cdn.net/uploads/default/original/1X/9b097af77834ef8a864650c5de31d6592f414088.jpeg) and for the constraints tick `defer validation until finalized` which let’s users go over the form and only check for errors at end… I use this method sometimes when administering some simple exams through ODK

You could also trigger note type questions with information to warn user of a possible violation of rules and remember to set `their required property to off`

Hoping this helps,

Cheers,  
Jules R
