Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi
I have two selectbox , and when i select option in one selextbox , i want to add option in other select box .

if i select 2 as value in one select box , i want to add 2 options to other select box..
and if i select 0 as value in one select box , i want to remove all options in other select box

pls give example in jquery


maulik shah
Posted
Comments
Maciej Los 8-Mar-14 14:50pm    
What have you done till now? Where are you stuck?
maulikshah1990 8-Mar-14 14:55pm    
on first select box change function,

if value of first box is small then second select box selected value ,
i use

var evalue = $("#childid :first-child").attr("value");
$("#childid option[value='"+evalue+"']").prop('selected',true);


i hope u understood

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