paul gordon wrote:

>I'm trying to implement your way of doing things, but can only get so far.
>
>What would the "_root.phonelist" refer to in my code?
>
>It is still only adding one mobile number, and I think this would be the 
>reason - sorry if I sound dumb!
>  
>
Don't worry about it... I spent 3 extremely painful weeks trying to 
create a fairly complex order form for a client before I started to get 
the hang of cfforms.

>>thisPhoneList.value.length = 
>>thisPhoneList.value.length+fartist.selectedItem.data;   
>>
ahem... typos in my code.... sorry... I wrote the email while I working 
on some stuff of my own and mixed the two up.

if (thisPhoneList.text.length >0)  thisPhoneList.text= thisPhoneList.text+',';
thisPhoneList.text = thisPhoneList.text+fartist.selectedItem.data;

_root.phonelist refers to the cfinput/cftextarea in your form where your mobile 
numbers are being copied to.

You need to remove the bind from your cfinput/cftextarea, otherwise it will 
override the action script that is populating it onchange of your dropdown.

Actionscript variables are case sensitive, so make sure that the field name is 
exactly the same in the scripting as it is in the cfinput/cftextarea.

Here's some corrected code.

<cfsavecontent variable="variables.namechange">
var thisPhoneList = _root.phonelist;
var selectedPhoneNo = _root.fartist.selectedItem.data;

var myClickHandler = function (evt){
    if (evt.detail == mx.controls.Alert.OK){
        if (thisPhoneList.text.length >0)  thisPhoneList.text = 
thisPhoneList.text+',';
        thisPhoneList.text = thisPhoneList.text+selectedPhoneNo;
    }
}
alert("Are you sure you want to add this mobile number?", "Warning", 
mx.controls.Alert.OK | mx.controls.Alert.CANCEL, myClickHandler);
</cfsavecontent>

<cfquery name="getArtists" datasource="cfartgallery">
SELECT *
FROM ARTISTS
</cfquery>
<cfform method="get" preloader="no" format="flash" skin="haloblue">
        <cfselect name="fartists" query="getArtists" display="FIRSTNAME" 
value="PHONE" onchange="#variables.namechange#" />
        <cftextarea name="phonelist" label="Selected Mobile Numbers" 
enabled="false" height="10" width="30" />
</cfform>

Stephen



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218401
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to