Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Select a default value in select box when calling values form external xml file
System
Hi,
I have to populate my select box using values from external xml file.
When the user tries to edit the existing dcr the values in the select box should be selected accordingly based on previous selection kindly advise how to do in form api
I have posted my code below kindly advise
[html]
if (L1parent_selected==pageid_arr)
{ newOptions=new Option(pagetitle_arr,pageid_arr,true,true);
}
else
{
newOptions=new Option(pagetitle_arr,pageid_arr,false,false);
}
var test = IWDatacapture.getItem("/infrastructure/content/L1Parent");
test.setOptions(newOptions);
IWDatacapture.redraw();
[/html]
L1parent_selected is the variable which stores my previous selection which is a page id.pageid_arr is the array which stores the values from the external xml.
Thanks
Find more posts tagged with
Comments
jbonifaci
Before you set the new options using setOptions, you're going to need to do a getOptions and save the previously selected options. Then when building your new options array, you're going to need to check to see if each new option was previously selected and set selected to true if so. Then pass this new options array to the setOptions method.
~Jeff