We have a beginning CFForm application where a dropdown list passes data over
to another dropdown list. Values passed to the second list can also be removed.
We've tried using javascript code from another project, however, CFMX7 returns
"Errors, warnings or exceptions were found when compiling
/cfbci-tlc/admin/dsp_Organization.cfm. Visit the online Flex documentation or
API reference for further information." when we use;
<cfformgroup type="vertical" visible="yes" enabled="yes">
<cfinput type="button" name="addstate" value="Add >>" width="100"
onclick="javascript:copyToList('this.From','this.To')">
<cfinput type="button" name="removestate" value="<< Remove" width="100"
onclick="javascript:copyToList('this.To','this.From')">
</cfformgroup>
We sure could use some help. I researched the actionscript side but that's
unfamiliar territory, but I suspect the answer lies there.
The complete code follows for dsp_Organization.cfm
Thanks in advance,
Don
********************
<cfif NOT IsDefined("FORM.OrgSubmitted") or FORM.OrgSubmitted NEQ 1>
<cfset tDoAction="">
<cfset tSetEnabled="Yes">
<cfset tGetButton="buttons1.cfm">
<cfset tTitle="Add Organization">
<cfelseif IsDefined("FORM.OrgSubmitted") and FORM.OrgSubmitted EQ 1>
<cfset tDoAction="organizationact.cfm">
<cfset tSetenabled="No">
<cfset tGetButton="buttons2.cfm">
<cfset tTitle="Confirm Organization">
</cfif>
<cfparam name="FORM.OrgName" default="">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<InvalidTag http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><cfoutput>#tTitle#</cfoutput></title>
<InvalidTag type="text/javascript">
// -------------------------------------------------------------------
// copyToList(from,to)
//this fx moves the selected items from one box to the other
// -------------------------------------------------------------------
function copyToList(from,to)
{
fromList = eval('forms[0].' + from);
toList = eval('forms[0].' + to);
if (toList.options.length > 0 && toList.options[0].value == 'temp')
{
toList.options.length = 0;
}
var sel = false;
for (var i=0;i<fromList.options.length;i++)
{
var current = fromList.options[i];
if (current.selected)
{
sel = true;
if (current.value == 'temp')
{
return;
}
txt = current.text;
val = current.value;
toList.options[toList.length] = new Option(txt,val);
fromList.options[i] = null;
i--;
}
}
reloadSubtopics();
if ((from != 'topic') && (from != 'topic_possible')){
sortSelect(fromList);
}
if ((to != 'topic') && (to != 'topic_possible')){
sortSelect(toList);
}
}
</script>
</head>
<body>
<!--- Check is token and Orgname exists --->
<!--- <cfif NOT ISDEFINED("session.token")>
<cflocation url="login.cfm" addtoken="No">
<cfelseif ISDEFINED("session.token") and FORM.OrgName IS "">
<cflocation url="organization.cfm" addtoken="No">
<cfelse> --->
<!--- 3 functions from the Resource component --->
<!--- <cfobject type="component" name="objGetStates"
component="cfbci-tlc.CFCs.Resource">
<cfset tResourceRelatedStates = objLogin.Resource(FORM.OrgName,
FORM.pswd, session.proxy)>
</cfobject>
<cfobject type="component" name="objGetResourceType"
component="cfbci-tlc.CFCs.Resource">
</cfobject>
<cfobject type="component" name="objGetExpertise"
component="cfbci-tlc.CFCs.Resource">
</cfobject> --->
<div align="center"><h2><cfoutput>#tTitle#</cfoutput></h2></div>
<cfform action="#tDoAction#" method="POST" height="500" format="Flash"
skin="haloGreen" accessible="Yes">
<cfinput type="Text" name="org_name" value=""
label="Organization Name: " tooltip="Organization Name" required="Yes"
visible="Yes" enabled="#tSetEnabled#" size="50" maxlength="150" tabindex="1">
<cfinput type="Text" name="org_Add1" label="Street
Address: " validateat="onBlur,onServer,onSubmit" message="Please enter a Street
Address." tooltip="Address" required="Yes" visible="Yes"
enabled="#tSetEnabled#" size="50" maxlength="150" tabindex="2">
<cfinput type="Text" name="org_city" label="City: "
validateat="onBlur,onServer,onSubmit" message="Please provide a City entry."
tooltip="City" required="Yes" visible="Yes" enabled="#tSetEnabled#" size="50"
maxlength="150" tabindex="3">
<cfselect name="state_id" size="1" width="70"
label="State:" tooltip="State" visible="Yes" enabled="#tSetEnabled#"
required="Yes" multiple="Yes" tabindex="4">
<option value="1">AK</option>
</cfselect>
<!-- Zip Code Group -->
<cfformgroup type="horizontal" label="Zip Code:" visible="Yes"
enabled="#tSetEnabled#">
<cfformgroup type="tile" label="Zip" visible="Yes"
enabled="#tSetEnabled#">
<cfinput type="Text" name="Zip5" value="" mask="99999"
validateat="onBlur,onServer,onSubmit" message="Please provide the first part of
your Zip Code." validate="zipcode" tooltip="Zip5" required="Yes" visible="Yes"
enabled="No" size="5" maxlength="5" tabindex="5">
<cfinput type="Text" name="Zip4" value="" mask="9999"
label="+ 4 optional" validateat="onBlur,onServer,onSubmit" message="Please
provide the last part of your Zip Code." validate="integer" tooltip="Zip4"
required="No" visible="Yes" enabled="#tSetEnabled#" size="4" maxlength="4"
tabindex="6">
<cfinput type="Hidden" name="org_zip"
bind="{Zip5.text}-{Zip4.text}">
</cfformgroup>
</cfformgroup>
<!-- End Zip Code Group -->
<!--- Telephone Group --->
<cfformgroup type="horizontal" label="Phone:" visible="Yes"
enabled="#tSetEnabled#">
<cfformgroup type="tile" label="" visible="Yes"
enabled="#tSetEnabled#">
<cfinput type="Text" name="Phone" value="" width="100"
mask="999 999-9999" validateat="onBlur,onServer,onSubmit" message="Please
provide a Phone entry." validate="telephone" tooltip="Phone" required="Yes"
visible="Yes" enabled="#tSetEnabled#" size="11" maxlength="14" tabindex="7">
<cfinput type="Text" name="Ext" width="100"
mask="99999" label="Ext." validateat="onBlur,onServer,onSubmit" message="Please
provide a Phone Extension entry." validate="integer" tooltip="Phone Extension"
required="No" visible="Yes" enabled="#tSetEnabled#" size="4" maxlength="4"
tabindex="8">
<cfinput type="Hidden" name="org_phone"
bind="{Phone.text} Ext-{Ext.text}">
</cfformgroup>
</cfformgroup>
<!--- End Telephone Group --->
<cfinput type="Text" name="site" label="Website if
available: " validateat="onBlur,onServer,onSubmit" message="Please provide a
City entry." validate="URL" tooltip="Website if available" required="No"
visible="Yes" enabled="#tSetEnabled#" size="50" maxlength="150" tabindex="9">
<cfselect name="org_type" width="300" size="1"
label="Organization Type:" tooltip="Organization Type" visible="Yes"
enabled="#tSetEnabled#" required="Yes" multiple="Yes" tabindex="10">
<option value="0">Select Organization
Type</option>
</cfselect>
<!--- Year Group --->
<cfformgroup type="horizontal" label="Grantee Year:"
visible="Yes" enabled="#tSetEnabled#">
<cfinput type="Radio" name="year" value="2004"
checked="Yes" tabindex="11" visible="Yes" enabled="#tSetEnabled#"
tooltip="2004">
<cfinput type="Radio" name="year" value="2003"
checked="No" tabindex="12" visible="Yes" enabled="#tSetEnabled#" tooltip="2003">
<cfinput type="Radio" name="year" value="2002"
checked="No" tabindex="13" visible="Yes" enabled="#tSetEnabled#" tooltip="2002">
</cfformgroup>
<!--- State(s) Covererd by Grantee group --->
<cfformgroup type="tile" style="marginTop: 0" height="240" visible="Yes"
enabled="Yes">
<cfselect name="From" size="5" multiple="true" visible="Yes"
enabled="Yes">
<option value="AK">AK</option>
<option value="AL">AL</option>
<option value="AZ">AZ</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
</cfselect>
<cfformgroup type="vertical" visible="yes"
enabled="yes">
<cfinput type="button" name="addstate"
value="Add >>" width="100"
onclick="javascript:copyToList('this.From','this.To')">
<cfinput type="button"
name="removestate" value="<< Remove" width="100"
onclick="javascript:copyToList('this.To','this.From')">
</cfformgroup>
<cfselect name="To" size="5" multiple="true" visible="Yes"
enabled="Yes">
<!--- Content returned from copyToList
<cfoutput><option>#toList#</option></cfoutput>
--->
</cfselect>
</cfformgroup>
<!--- End State(s) Covererd by Grantee group --->
<cfformitem type="text" visible="Yes" enabled="Yes">
Paste Description of Organization Services Text Below
</cfformitem>
<cftextarea name="org_desc" width="500" label="" required="no"
value=""
visible="Yes" enabled="#tSetEnabled#" tooltip="Paste
Description of Organization Services Text Below"></cftextarea>
<cfinput type="Hidden" name="OrgSubmitted" value="1">
<!--- <cfinclude template="../includes/#tGetButton#">
--->
</cfform>
<!--- </cfif> --->
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199212
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54