Hi all, I have created a drop down box that contains usersnames. Is there a easy way to populate a hidden email address field based on the username selected by the user.
Thanks in advance
You can either call a javascript function in your select field's 'onChange'
event, which would set the value of your email field or submit the page to
itself and read the value of the username form field using the 'URL' or 'FORM'
structure based on your form method 'GET' or 'POST'
EdmondsM - 31 Jan 2005 22:37 GMT
BSterner, How would I go about making the page call itself upon selecting the
check boxes?? So, based on the username they select I can populate a hidden
field with the email address. Is this easily done with more than one dropdown
box. thanks
You could simply keep email address together with the user name:
<select name="users">
<option value="user1,user1@domain.net">user1
<option value="user2,user2@server.com">user2
</select>
Split user name and email address on the calling page.
EdmondsM - 31 Jan 2005 00:38 GMT
Thanks for the response Mr. Black, So call the username and email address at
the same time within the option tag. Could I call the email address in a
hidden field?? I will give that a shot. Thanks again.
EdmondsM - 31 Jan 2005 21:31 GMT
Mr. Black, this is not working. I am trying to call the username and email
address from a table to populate the dropdown box. The box gets populated
fine. I just can't get the calling page to see the email address.
Mr Black - 31 Jan 2005 22:59 GMT
<cfset user=ListGetAt(users, 1)>
<cfset email=ListGetAt(users, 2)>