What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 21466 |  Welcome, Guest!   Register  Login
 Home > Forums > JavaScript > how to bind 3 list items in the asp.net dropdownlist using Javascript ...
Macson

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

Replies: 1 | Posted by: Macson on 7/3/2009 | Category: JavaScript Forums | Views: 4301 | Status: [Member]  


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


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vuyiswamb
Vuyiswamb  
Posted on: 7/6/2009 4:43:02 AM
Level: NotApplicable | Status: [Member] [MVP] [Administrator]

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. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 10:30:53 PM