Click here to Skip to main content
15,922,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using jquery for select drop down value when i select $("#ddlMgArticle option:selected").text(artnam); particular value another value should be same

my problem is
/blue
/Red
/green
artname=red
after i use this
option:selected").text(artnam)
the output is

/blue
/REd
/Red

Over over ride my previous value please help me
Posted
Comments
Bajirao_ 18-Oct-13 8:57am    
Its true it will overwrite the selected text but its strange you are assigning value "red" and getting "REd". Provide your current html/Jquery code.

May be you are looking something like this.

$("#ddlMgArticle option").each(function(index){
if($(this).val().length){
if($(this).val().toLowerCase() == artnam.toLowerCase()) {
exists = true; // take index if you want and make it as selected.
}
}
});

if(!exists){
// add it and make as selected
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900