Something like this:

<cfquery name="q" datasource="#dsn#">
SELECT id, name, address,  phone
FROM users
</cfquery>

<!--- Load the wddx.js file --->
<script type="text/_javascript_" src=""> <script>
   // Use WDDX to move from CFML data to _javascript_
   <cfwddx action="" input="#q#" topLevelVariable="qj">
   function Populate(f){
     var i = f.User.selectedIndex - 1; // take the blank option into
account
     f.UserAddress.value = qj.getField(i,"address");
     f.UserPhone.value = qj.getField(i,"phone");
   }
</script>
<form action="" method="post">
Customer:
<select name="User" size="1" > <option value="">- select one -</option>
<cfoutput query="q">
<option value="#q.name#">#q.name#</option>
</cfoutput>
</select><br/>
Address:
<input name="UserAddress" type="text" readonly="true"><br/>
Phone:
<input name="UserPhone" type="text" readonly="true"><br/>
...
</form>

Pascal

> -----Original Message-----
> From: Kevin [mailto:[EMAIL PROTECTED]
> Sent: 26 July 2004 11:31
> To: CF-Talk
> Subject: RE: HELP. CF and _javascript_ question
>
> Thanks Pascal,
>
>
>
> I read the pages on the wddx object and got the query loaded into an
> array.
> Problem is I am now unsure how to reference it. :-( Unfortunately the
docs
> are not very specific on the syntax to actually use and reference the
> array.
> Or at least not to a newbie. :-( If I post the code generated by it
that
> builds the array, can someone help me match the proper array element
to
> the
> menu selection?
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to