The function is not correct:

   function Populate(f){
     var i = f.User.selectedIndex - 1; // take the blank option into
account
     if(i<0){
       f.UserAddress.value = "";
       f.UserPhone.value = "";
     }
     else{
       f.UserAddress.value = qj.getField(i,"address");
       f.UserPhone.value = qj.getField(i,"phone");
     }
   }

Pascal

> -----Original Message-----
> From: Pascal Peters [mailto:[EMAIL PROTECTED]
> Sent: 26 July 2004 13:59
> To: CF-Talk
> Subject: RE: HELP. CF and _javascript_ question
>
> 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
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to