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(&q uot;idAtta chmentsTab le");
if (elm == null || elm.rows.length == 0)
document.getElementById(&q uot;idAtta chmentsRow ").st yle.displa y='no ne';
_spBodyOnLoadFunctionNames .push(&quo t;fillDefa ultValues& quot;);
function fillDefaultValues()
{
var opt=document.getElementByI d("ct l00_m_g_f1 2af616_6ab 4_4c5c_a59 b_146a2e9b 17ae_ff61_ ctl00_ctl0 0_SelectGr oup") ;
var opts = opt.options;
var l = opts.length;
opts.selectedIndex = 4;
}
var elm = document.getElementById(&q
if (elm == null || elm.rows.length == 0)
document.getElementById(&q
_spBodyOnLoadFunctionNames
function fillDefaultValues()
{
var opt=document.getElementByI
var opts = opt.options;
var l = opts.length;
opts.selectedIndex = 4;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also please use the code block to write the code. That shows us a bit of clear code.