dcsimg
How to add or delete values from the drop down box
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ramesh_Chowdhary
Posted On:   Monday, December 30, 2002 04:04 PM

How to add previous option value to the same drop down box on checking the checkbox which has been deleted when a checkbox is unchecked function unCheck() { alert(document.forms['frmInside'].elements['locale1']); //.elements['locale1'].value); var optLocale=document.createElement("OPTION"); optLocale.value=document.forms['frmInside'].ClientEnabledLocale.options[0].value; optLocale.text=document.forms['frmInside'].ClientEnabledLocale.options[0].text; var i=1; if(document.forms['frmInside'].locale1.checked==false) { //alert(objValue); //alert(objText); document.forms['frmInside'].ClientEnabledLocale.options.remove(0); } else //if   More>>

How to add previous option value to the same drop down box on checking the checkbox which has been deleted when a checkbox is unchecked


function unCheck()
{
alert(document.forms['frmInside'].elements['locale1']);
//.elements['locale1'].value);
var optLocale=document.createElement("OPTION");
optLocale.value=document.forms['frmInside'].ClientEnabledLocale.options[0].value;
optLocale.text=document.forms['frmInside'].ClientEnabledLocale.options[0].text;
var i=1;
if(document.forms['frmInside'].locale1.checked==false)
{
//alert(objValue);
//alert(objText);
document.forms['frmInside'].ClientEnabledLocale.options.remove(0);
}
else //if(document.forms['frmInside'].elements['locale1'].checked==true)
{

//alert(optLocale.value);
//alert(optLocale.text);
document.forms['frmInside'].ClientEnabledLocale.add(optLocale,0);
}

}




<%=posCELocales+1%> checked onClick="unCheck();" >

   <<Less

Re: How to add or delete values from the drop down box

Posted By:   Nitesh_Naveen  
Posted On:   Tuesday, December 31, 2002 03:49 AM

Please format and indent the code blocks when you post a question!!! For deleting and adding options to dropdown see this faq (click here)
About | Sitemap | Contact