Discussions
Checkbox and dropdown list box not working in Button event
I'm trying to set the value of the checkbox to false and the index of the dropdown list box to 0 when the button is pressed. Though the code snippet below works for text boxes, it doesn't work on dropdown list box and check boxes. It is easily achieved in clientscript using nlapiSetfieldValue but I'm coding it in server side script.
// The code for textbox works fine var btnEvent = "document.getElementById('textbox1').style.display='none';"; btnEvent += "document.getElementById('textbox2').style.display='none';"; btnEvent += "document.getElementById('textbox3').style.display='none';"; // The code for dropdown and checkbox does not trigger when the button is pressed btnEvent += document.getElementById('dropdownlistbox').selectedIndex=0;"; //btnEvent += "document.getElementById('dropdownlistbox').options(0).selected = true;"; //btnEvent += "document.getElementById('dropdownlistbox').options[0].selected = true;"; //btnEvent += "document.getElementById('dropdownlistbox').options[0].text = '';"; //btnEvent += "document.getElementById('checkbox').checked='false';"; // the btnEvent is supposed to reset the values of the objects as defined in the codes above form.addButton("custpage_new_authorization","Get New Authorization (Starry Temp)", btnEvent);