Reset 'select box' value back to "--None--" on UI Page

xiaix
Tera Guru

I have a service catalog item that, based on xyz, will pull up a UI Page, in which I've perfectly matched the fields.

The following code works GREAT! with all fields except for those fields that are drop-downs (select box), that has a value of --None--

var items = document.getElementsByTagName('item');

var myField = '';

var myFieldID = '';

var field;

for (var i = 0; i < items.length; i++)

{

      // Clear out all fields

      myField = items[i].id;

      myFieldID = '';

      if (myField.length > 0)

      {

              myFieldID = ("IO:" + myField);

      }

      if (myFieldID.length > 0)

      {

              field = gel(myFieldID);

      }

      if (field)

      {

              field.value = '';

              variableOnChange('IO:' + myField);

      }

}

It clears out all the data, but will not put those darn slect boxes back to --None--

Any ideas?

1 ACCEPTED SOLUTION

I figured it out... and it's my fault.   It was my code.   Setting field.value = '' does indeed work.  


View solution in original post

7 REPLIES 7

Brian Dailey1
Kilo Sage

Hi David,



For the Select boxes, try setting the value to null instead.




Thanks,


-Brian


Already tried that, but didn't work.  



field.value = null;


Brian Dailey1
Kilo Sage

Can you post the code from the UI Page that created the control?   Let us see how it's setup.




-Brian


There is no code that placed the control onto the form.



It's a Variable, within a Variable Set, Select Box:


find_real_file.png