Flipkart

Friday, August 7, 2009

Adding and Removing Options in Selectbox Using JS

function addoption(text,id) {
var feed = document.form.selectboxname;
var flag=true;
for (i=0;i<feed.length;i++) &&="" (!flag)="" (feed.options[i].value="=id)" (feed.selectedindex="" );="" alert(="" already="" feed.options[feed.length]="new" feed="document.form.selectboxname;" flag){="" flag="false;" function="" id);="" id="" if(text="" if="" inserted="" option(text,="" remove_category()="" var="" {="" }="" }else{="">= 0) feed.remove(feed.selectedIndex);
}</feed.length;i++)>

No comments:

Post a Comment