Login    Forum    Search    FAQ   Blog

Board index » Client-Side Development » Javascript




 Page 1 of 1 [ 3 posts ] 



Author Message
 Post subject: Clear data in a combobox
 Post Posted: Wed Feb 25, 2009 9:20 pm 
Offline

Joined: Sat Feb 21, 2009 3:16 pm
Posts: 46
Hi all,
How to clear a list of contents in a combobox in javascript.

I mean i want to clear the contents of the combobox and want to add new contents in the same combobox.

How to do this please.
Thanks


Top 
 Post subject: Re: Clear data in a combobox
 Post Posted: Wed Feb 25, 2009 9:48 pm 
Offline

Joined: Sat Feb 21, 2009 12:42 pm
Posts: 12
here is a sample

function fnClearOptions(){
document.getElementById("optionsId").options.lenth =0;
}

function fnAddOptions(){
document.getElementById("optionsId").options[document.getElementById("optionsId").options.length] = new Option('New Option');
}

_________________
Sleep to dream, wake to acheive.


Top 
 Post subject: Re: Clear data in a combobox
 Post Posted: Thu Feb 26, 2009 9:42 pm 
Offline

Joined: Sat Feb 21, 2009 3:16 pm
Posts: 46
Thanks. That did the work.


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 3 posts ] 




Board index » Client-Side Development » Javascript


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron