Tech Support > Microsoft Windows > Windows CRM > Populating Picklist
Populating Picklist
Posted by rev on December 20th, 2006


Hi,

I have created 2 picklist new_category and new_subcategory. I want the the
second picklist to be populated based on the first picklist. Unfortunately
my second picklist is populating randomly and i have multiple sets of the
same data appearing everytime i click on any of the items. Can anyone tell me
what I m missing out here. Thanks in advance. I m attaching my codes for the
onLoad below.
--
Thank you
-rev-

------------------------codes----------------------------------
switch(crmForm.all.new_category.SelectedText) {

case "ATM":
crmForm.all.new_subcategory.AddOption("Lost Card")
crmForm.all.new_subcategory.AddOption("Lost PIN")
crmForm.all.new_subcategory.AddOption("Faulty Card")
crmForm.all.new_subcategory.AddOption("Others")
break
case"Credit Card":
crmForm.all.new_subcategory.AddOption("Monthly Statement")
crmForm.all.new_subcategory.AddOption("Payment")
crmForm.all.new_subcategory.AddOption("Faulty Card")
crmForm.all.new_subcategory.AddOption("Others")
break
default:
crmForm.all.new_subcategory.AddOption("Housing ")
crmForm.all.new_subcategory.AddOption("Education")
crmForm.all.new_subcategory.AddOption("Automotive" )
crmForm.all.new_subcategory.AddOption("Personal")

}

Posted by Michael Höhne on December 20th, 2006


You need to clear the existing options before adding new ones, otherwise
your list will become longer every time you make a change to the
new_category field. Insert the following before your switch block and it
should work:

crmForm.all.new_subcategory.innerHTML = "";

--
Michael

Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx
Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup

----------------------------------------------------------

"rev" <rev@discussions.microsoft.com> schrieb im Newsbeitrag
news:F0258265-56DC-4154-B516-D071ED962D55@microsoft.com...


Posted by rev on December 21st, 2006


Thanks Michael........

It works the way i want it.
--
Thank you
-rev-


"Michael Höhne" wrote:

Posted by rev on December 21st, 2006


I have just encountered another problem. When I include that statement to
clear the options, it doesnt read any other option besides the first one for
each case. Eg: if my category is ATM, the sub category displays all the
options for ATM but it only allows the first option 'Lost Card' to be choosen
only. I cant choose any other sub-option.
--
Thank you
-rev-


"Michael Höhne" wrote:


Similar Posts