Hi guys,
I need help mixing js and cf - on my form i have a disabled text box that i need to update when a value is picked from a select box.
I have a query that pulls out the ID of a pc, plus the username it is allocated to and their email address. My select displays the username, when one is selected i want my text box to be populated with the corresponding email address - how can i do this?
I have another text box on the form that is populated with the pc id number when the username is picked from the same select, but how do get the email address to display??
Any help is gratefully appreciated!!
Nicola
I need help mixing js and cf - on my form i have a disabled text box that i need to update when a value is picked from a select box.
I have a query that pulls out the ID of a pc, plus the username it is allocated to and their email address. My select displays the username, when one is selected i want my text box to be populated with the corresponding email address - how can i do this?
I have another text box on the form that is populated with the pc id number when the username is picked from the same select, but how do get the email address to display??
Code:
<!--- query the database for the laptop numbers and users that havent yet been returned--->
<cfquery name="qryLaptop" datasource="StaffBadges" >
SELECT u.UpgradeFK, l.ID, l.LAPno, l.BadgeName, l.EmailAddress
FROM tblUpgradeLaptop AS u
RIGHT OUTER JOIN LaptopNames AS l ON u.LaptopFK = l.ID
WHERE (u.LaptopFK IS NULL)
AND (l.ID IS NOT NULL)
ORDER BY LAPno
</cfquery>
<select name="laptopNo" size="1" >
<option value="0">Select from...</option>
<cfoutput query="qryLaptop">
<option value="#ID#">#LAPno# - #EmailAddress#</option>
</cfoutput>
</select>
<input type="text" disabled name="laptopID" />
<input type="text" disabled name="email"/><br />
<label>Handed In On: </label>
<input type="text" size="10" name="Date_In" value="<cfoutput>#TodayIS#</cfoutput>" onFocus="this.form.laptopID.value=form.laptopNo.options[form.laptopNo.selectedIndex].value;"/>
Nicola