Hi, I need to delete a few elements from my combo box based on certain condition. I'm able to add contents into Combo Box at run-time using OPtion object but not able to delete. How can I go about doing this ... plz guide me Thanking u in advance, Aman
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
Aman I assume your using the options array to add the new items to your list. To delete and item just set its index to null. If you have a list named myList do this: myList.options[2] = null; This will remove the 3rd item from the options array and also compress the array. If the original options were 'item1, item2,item3,item4' after the above line it would now be: 'item1,item2,item4' hope that helps Dave
PS you'lleed to refresh the page to get the actual list on the screen to change. history.go(0); works but it must be the last thing you do.
Dave
Aman Rustogi
Greenhorn
Joined: May 11, 2001
Posts: 22
posted
0
Thx Dave. But i guess i cannot refresh the page as it contains hell lot of data. Newayz thx for providing the tip !! aman
Terence Doyle
Ranch Hand
Joined: May 30, 2001
Posts: 328
posted
0
Hi,
Just a suggestion here, but if the form/page contains a lot of data it might be more userfriendly to break it down into several small steps which are presented/filled in separately. This way the user might feel it's less tedious and you could do your refresh and have more dynamic content!
Terry
Raising Flares debut album 'Ignition' out now
http://www.raisingflares.com
Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Urgent !! Deleting elements from Combo Box