Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Forums Author
Sun, 20-Apr-2014 Authors
All Time Authors
Jayakumars
3930
Karthikanbarasan
3455
Chvrsri
3140

Latest members | More ...


(Statistics delayed by 5 minutes)

how to bind 3 list items in the asp.net dropdownlist using Javascript

Macson
Posted by Macson under JavaScript on 7/3/2009 10:14:39 PM | Views : 5000 | Status : [Member] | Replies : 1
how to bind 3 list items in the asp.net dropdownlist using Javascript



Reply | Reply with Attachment

=> Scroll below for responses


Comments or Responses

Posted by: Vuyiswamb on: 7/6/2009 [Member] [MVP] [Administrator] NotApplicable

Good Day

It can be done this way

script type="text/javascript">

function AddItem(Text,Value)
{
// Create an Option object var opt = document.createElement("option");

// Add an Option object to Drop Down/List Box
document.getElementById("DropDownList").options.add(opt); // Assign text and value to Option object
opt.text = Text;
opt.value = Value;

}<script />


Thank you for posting at DotnetFunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Macson, if this helps please login to Mark As Answer. | Alert Moderator


Login to post response.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.

Found interesting? Add this to: