While giving None in the field mandatory is not happening in catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 12:18 PM
Hi ,
I have 2 field and it has dependency . script below
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.clearOptions('Sample2');
g_form.clearValue('Sample2');
}
var ostype = g_form.getValue('os_type');
g_form.clearOptions('os_version');
if (Sample1 == 'win')
{
g_form.addOption('Sample2','field1','Field1');
g_form.addOption('Sample2', 'fiel2','Fiel2');
}
else if(Sample1 == 'linux'){
g_form.addOption('Sample2', 'field3','Field3');
}
So i am adding option based on the value selection .And each Sample1 and Sample2 as mandatory an it include None .
If i am selecting option from sample1 its taking values based on my selection in sample2 but if i give none in sample1 its not selecting None in sample2 instead its coming as blank field. Due to that mandatory is not happening. Anyone has any suggestion?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 12:55 PM
I believe the value for none in a client script is an empty string "". Try if (Sample1 == '') and you should use a UI Policy to make Sample2 read only if Sample1 is none, this will force the user to answer the questions in the correct order.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017 09:59 PM
Hi Frank,
Client wants that field to be enter.they don't want to make the field read only.. I think it is something index issue.but I am not clear about it.its happening in service portal.