Re: help me in this issue



venky_lb wrote:
Hi,
im new to javascript ,

You may also be new to usenet. Try a newsgroup with "javascript" in it's it's name. Like: comp.lang.javascript . Your question is off topic here in comp.lang.php. And asking OT questions has consequences that can be easily avoided but posting in the appropriate group.

Jeff


here im trying to select an category from
select option ,and that category must display on other select option

2. remove is working fine

pls assist
<script type="text/javascript">
function addOptions(selcat,selmc)
{
var sel=document.getElementById(selcat);
var val=document.getElementById(selmc);
if (val.length==0) return;
for (var i=0;i<zxcsel.options.length;i++){
if (sel.options[i].text== val) return;
}
sel.options[sel.options.length]=new Option(val,'',true,true);
sel.selectedIndex=0;
}
function removeOptions(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--) {
if(selectbox.options[i].selected)
selectbox.remove(i);
}
}
</script>
<input type="text" name="category" id="category" value="" size="30" /
//place where i select categories
<input type="button" name="in_add" id="in_add" class="btn_yellow"
value="Add" onclick="addOptions('category','multiselect')";/>

<select name="sel_category" id="multiselect" multiple="multiple"
size="5"> //the selected categories should
<option value="">Automotive Parts</option>
<option value="">Cars</option>
<option value="">Computers</option>
<option value="">Electronics</option>
<option value="">Equipments</option>
<option value="">Rental Property</option>
<option value="">Tickets</option>
</select>
<input type="button" name="in_remove" id="in_submit"
class="btn_yellow" value="Remove"
onClick="removeOptions(multiselect)";/>

Thanks
.


Quantcast