THANKS!!! I was able to decipher the code and adapt it t my form design and
query. Now that I have implemented it once I shall be able to do this again
on my own. I thank you from the bottom of my heart! You saved my day. :-D
I have one more question if you don't mind. On some one of the fields it is
possible to have a null value. (addressLine2) In those cases it places
"null" into the field value. Is there a simple check I can place inside the
Populate function to replace the null with a blank space? Something like:
If (qj.getField(I,"addressLine2") = "") {
f.addressLine2.value = " ";
} else {
f.addressLine2.value = qj.getField(i,"addressLine2");
}
Thanks,
Kevin
_____
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]

