Link to home
Start Free TrialLog in
Avatar of newbie27
newbie27Flag for United Kingdom of Great Britain and Northern Ireland

asked on

jQuery/javascript plugin advice

Hello Experts,
I wonder If there is any jQuery plugin for 2 drop down list box which could be used to select one are all from one list to another list.
Something like one attached.
Please can you advice or is it easily be done in javascript?
Thanks for your help
Regards
S
screen.JPG
Avatar of Ali Kayahan
Ali Kayahan
Flag of Türkiye image

Save the file as lib.js and link it from the document that you are using ,than you can use the PHP code below to dynamically populate DropDowns,if you dont use php basicly logic is that ;
<form action="#" method="post" >
<select class="inputbox" name="cat" onChange="filterSelect(subcat,this)">
 <option value="">--Select Category--</option>
<option value='test1'>test1</option>
<option value='test2'>test2</option>
</select>
<select class="inputbox" name="subcat" disabled="true">
<option value="" filter="">---Select Subcategory---</option>
<option value='somevalue' filter='test1'>Someoption</option>
<option value='somevalue' filter='test2'>Someoption</option>
</select>
<?php 
 $category = array("scripting","cars","hobbies") ;
 $num1 = count($category) ;
 $subcategory = array("php;asp;jsp","bmw;mercedes;jaguar","swimming;cycling;skieing") ;
?>
<form action="#" method="post" >
<select class="inputbox" name="cat" onChange="filterSelect(subcat,this)">
 <option value="">--Select Category--</option>
<?php 
 for($z = 0;$z < $num1;$z++) {
 	echo "<option value='$category[$z]'>$category[$z]</option>" ;
 }	
?>
</select>
<select class="inputbox" name="subcat" disabled="true">
<option value="" filter="">---Select Subcategory---</option>
<?php 
 for($y = 0;$y < $num1;$y++) {
 	$menus = explode(";",$subcategory[$y]) ;
	$num2 = count($menus);
		for($x = 0 ;$x < $num2;$x++) {
 		echo "<option value='$menus[$x]' filter='$category[$y]'>$menus[$x]</option>" ;
		}
 }	
?>
</select>

Open in new window

lib.txt
Avatar of newbie27

ASKER

hello,
can you please help me out in this

http://213.253.134.6/artism/admin/list_export.asp

i am trying to add values from list1 to list2

thanks
SOLUTION
Avatar of Ali Kayahan
Ali Kayahan
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks, please see
http://213.253.134.6/artism/admin/list_export.asp
can we not change the events by using the onclick events on the buttons please?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"can we not change the events by using the onclick events on the buttons please?" What you mean by that ?
thanks hielo, that worked !