Client scripting: disable options from a dropdown

(courtesy of ServiceNow Guru:

//--remove the state options from the dropdown
    var control = g_form.getControl('state');
    var options = control.options;
    for (var i = 0; i < options.length; i++) {
        var option = options[i];
        var ov=option.value;
        if (ov!='-24') {
            control.options[i].disabled = 'true';


Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage