How to prevent user from selecting 'None' for a mandatory field on a change request form.

LK11
Mega Expert

Hi All,

 

I have a field 'Justification' which is a conditional mandatory field, and it's a drop down list from where a user can select a choice.  When the 'Justification' field is not mandatory, 'none' is the default choice and the user can submit the form. 

The issue is that when 'Justification' is mandatory, if the user just clicks on the drop down list and selects 'None', they're able to submit the form.  Is there a way to prevent this and force the user to select a choice from the drop down list before submitting?

 

Thank you

1 ACCEPTED SOLUTION

Hi,

Below is what I did:

1. Wrote a onChange client script:

find_real_file.png

2. Out Put Risk is not mandatory 

find_real_file.png

2. OnChange when value is 2 for Priority

find_real_file.png

 

Thanks

View solution in original post

22 REPLIES 22

You need to do exactly what m.osborne outlined, check mark that "none" box, it works like a charm. I also like to use  UI policies to set fields mandatory. 

Munender Singh
Mega Sage

Hi,

Kindly make a new on-change client script and put the following line in it:

g_form.removeOption(<fieldName>, <choiceValue>);

 

Regards,

Munender

Mrigank Gupta
Giga Expert

There are two ways to do it :

1. The point when you are making Justification mandatory, remove the --None-- option from it by a onChange client script.

2. in before BR, add a check that if the value is None, just abort the action.