Link to home
Start Free TrialLog in
Avatar of Kevin Robinson
Kevin Robinson

asked on

SharePoint - Select List

I have used the following JavaScript to set the default item in a "List form Field"   The script is working and the correct item in the combo box is selected  but the event has not fired to reload the list box. below.  If I select an item manually (i,e. with a mouse) it works fine.  What have I missed.

var elm = document.getElementById("idAttachmentsTable");
          if (elm == null || elm.rows.length == 0)
          document.getElementById("idAttachmentsRow").style.display='none';
         
         
         
  _spBodyOnLoadFunctionNames.push("fillDefaultValues");



function fillDefaultValues()
{
var opt=document.getElementById("ctl00_m_g_f12af616_6ab4_4c5c_a59b_146a2e9b17ae_ff61_ctl00_ctl00_SelectGroup");

var opts = opt.options;
var l = opts.length;
opts.selectedIndex = 4;

      
      }


User generated image
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

The question is not very clear. Can you please explain a bit more. Is this the entire code?

Also please use the code block to write the code. That shows us a bit of clear code.
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial