excellent pravinasar
It is working perfect
Thank you
Main Topics
Browse All TopicsHello experts.
I have a code with two related selects using the bind function
The problem i have is to get the selected values after the form is submitted when i have selected more than one value by multiple="yes"
The code i have is working but only with one value.
Any help?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Adding control for child should work similarly.
Here are changes you have to do.
Look at
JS function SelectMultiDefault2(x,val)
<cfajaxproxy bind="javascript:SelectMul
<cfselect name="submoduleid" id="submoduleid" value="SubModuleId" multiple="yes" size="20" display="SubModuleName"
bind="cfc:Modules.GetSubMo
Finally i get it work the way i wanted .
Here are the changes in the script:
<script type="text/javascript">
var imdone7 = false;
var imdone8 = false;
function Select1MultiDefault(x,val)
if(!imdone7) {
var valarray=val.split(',');
var dd = document.getElementById('M
for(var i = 0; i < dd.length; i++)
{
for (var ax=0; ax < valarray.length; ax++)
{
if(dd.options[i].value == parseInt(valarray[ax]) )
{
dd.options[i].selected = true;
}
}
}
}
imdone7 = true;
}
function SelectMultiDefault2(x,val)
if(!imdone8) {
var valarray=val.split(',');
var dd = document.getElementById('S
for(var i = 0; i < dd.length; i++)
{
for (var ax=0; ax < valarray.length; ax++)
{
if(dd.options[i].value == parseInt(valarray[ax]) )
{
dd.options[i].selected = true;
}
}
}
}
imdone8 = true;
}
Business Accounts
Answer for Membership
by: pravinasarPosted on 2009-07-24 at 08:35:11ID: 24935967
Here is a way to handle mutliple select.
1. Update the query for SubModule Selection
<cfcomponent output="no">
<cffunction name="GetModules" access="remote" returntype="query">
<cfquery name="data" datasource="YOURSQL">
SELECT ModuleId, ModuleName from tblModules
WHERE IsActive = 1
ORDER BY ModuleName
</cfquery>
<cfreturn data>
</cffunction>
<cffunction name="GetSubModules" access="remote" returntype="query">
<cfargument name="moduleId">
<cfquery name="data" datasource="YOURSQL">
SELECT SubModuleId, SubModuleName from tblSubModules
WHERE IsActive = 1 AND ModuleId IN (#arguments.moduleid#)
ORDER BY SubModuleName
</cfquery>
<cfreturn data>
</cffunction>
</cfcomponent>
2. Use the function SelMutliDefault
Look at following code.
Select allOpen in new window