Firstly, apologies if the answer to this is staring me in the face but I've been trailing Google and forums for a week now and I'm a little bamboozled... (also fairly new to asp/javascript so please be gentle!)
Okay, to my problem...
I have one dropdown and 2 textboxes - all info for these are pulled from a database. Populating the dropdown is fine but I need to fill the textboxes with the rest of the record when the user selects from the dropdown. I've had a go with using the OnChange but I'm not sure the best/correct way to go about getting the values into the function - I've tried putting the recordset into an array. Here's a snippet of the code I'm using to build the dropdown:
I've tried:
to pass the array but basically I'm not sure what to do once I'm in the function - I've tried a few things, I thought (probably rather naively) the following would be on the right track:
Sorry for going on so long. Any pointers?
pmrankine
Okay, to my problem...
I have one dropdown and 2 textboxes - all info for these are pulled from a database. Populating the dropdown is fine but I need to fill the textboxes with the rest of the record when the user selects from the dropdown. I've had a go with using the OnChange but I'm not sure the best/correct way to go about getting the values into the function - I've tried putting the recordset into an array. Here's a snippet of the code I'm using to build the dropdown:
Code:
<select size="1" name="user_full_name" class="a" onchange="setDetails()">
<option>Select Name</option>
<%
For i = 0 to UBound(aryUserDetails,2)
strFullName = strFullName & "<option value='" & i & "'>" & aryUserDetails(0,i) & "</option>" & vbcrlf
Next
Response.Write(strFullName)
%>
</select>
Code:
onchange="setDetails(aryUserDetails)"
Code:
function setDetails()
{
intAryValue = document.frm_tech.user_full_name.value;
document.frm_tech.user_email_address.value = aryUserDetails(2,intAryValue);
}
pmrankine