Flash "Slush Box"
Ron Pasch from Prisma-IT has put together a great example of a dual select box, or as some call it a "slush box".
This example connects two
Update: Ray Camden has taken this example updated it and wrapped it up in a custom tag. Download it here
<cfsavecontent variable="addScript">
if(lb1.selectedIndices != undefined)
{
var r:Array = lb1.selectedIndices.sort(16|2);
for( var i=0; i<r.length; i++ )
{
lb2.addItem(lb1.getItemAt(r[i]));
lb1.removeItemAt(r[i]);
}
}
</cfsavecontent>
<cfsavecontent variable="selectAll">
var bah:Array = Array();
for(var i=0; i<select1.length; i++)
{
bah[i] = i;
}
select1.selectedIndices = bah;
var bah:Array = Array();
for(var i=0; i<select2.length; i++)
{
bah[i] = i;
}
select2.selectedIndices = bah;
</cfsavecontent>
<cfdump var="#form#">
<cfform format="flash" width="500" onSubmit="#selectAll#">
<cfformgroup type="horizontal">
<cfselect name="select1" width="200" size="10" multiple="Yes">
<option value="1">Sue Hove</option>
<option value="2">Simon Slooten</option>
<option value="3">Ron Pasch</option>
</cfselect>
<cfformgroup type="vertical">
<cfinput type="Button" name="addi" value=">" height="25" width="30" onclick="var lb1=select1;var lb2=select2;#addScript#">
<cfinput type="Button" name="deli" value="<" height="25" width="30" onclick="var lb1=select2;var lb2=select1;#addScript#">
<cfinput type="Button" name="adda" value=">>" height="25" width="30" onclick="var lb1=select1;var lb2=select2;#selectAll##addScript#">
<cfinput type="Button" name="dela" value="<<" height="25" width="30" onclick="var lb1=select2;var lb2=select1;#selectAll##addScript#">
</cfformgroup>
<cfselect name="select2" width="200" size="10" multiple="Yes"></cfselect>
</cfformgroup>
<cfinput type="submit" name="btn" value="Submit">
</cfform>

There are no comments for this entry.
[Add Comment] [Subscribe to Comments]