-- None -- option gets added in a choice list. How do disable this

jayjay
Tera Contributor

I have a choice list from which i can choose multiple options.  However when I am able to add the " None" option also to the selected options.

find_real_file.png

Subsequently, when i submit the form the "None"  option also gets submitted. How do make sure that when  this?

find_real_file.png

My Requirement needs "Dropdown with None". Can anyone help with this?

Thanks! 

 

11 REPLIES 11

Sathish6
Kilo Contributor

Hi any one got this update?

Bryan Tay3
Mega Guru

hi there, 

Thought of sharing how I overcome this problem with a OnChange Client Script as below:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

   //Type appropriate comment here, and begin script below
    if(newValue.includes('-- None --')){
        var arrValues=newValue.split(',');
        var outArr=[];
        for(var i=0;i<arrValues.length;i++){
            var eachSelection=arrValues[i];
            if(eachSelection!='-- None --'){
                outArr.push(eachSelection);
            }
        }

//note that second array is the Display Value array for the GlideList.
        g_form.setValue('u_service_response_service',outArr,outArr);
   }
}

hope this helps. 🙂