
insertAdjacentHTML Questions...
What im trying to do is, when a user changes a select box on the page, i
run a remote scriping script, and i want
to insert the values into another select box, only i cant figure it out.
Where am i going wrong?
My Remote Scripting is in
VBScript and works great.
<Form action="NoActualRev.as" Method=Post Id=frm Name=frm>
<Table>
<tr>
<td>
<Select name="SalesTeamID" onChange="ListUsers()"
style="width:260;height:25">
<%
If Session.Contents.Item("Access") = 1 then
Do While Not oRec.EOF
Response.Write "<option value="&
Trim(oRec.Fields.Item("SalesTeamID")) & ">" &
oRec.Fields.Item("Description")
oRec.MoveNext
Loop
Else
Do While Not oRec.EOF
If Trim(oRec.Fields.Item("SalesTeamID")) =
Trim(Session.Contents.Item("SalesTeamID")) Then
Response.Write "<option value="&
Trim(oRec.Fields.Item("SalesTeamID")) & ">" &
oRec.Fields.Item("Description")
End If
oRec.MoveNext
Loop
End If
%>
</Select>
</td>
</tr>
<tr>
<td>
<!-- Ive messed with so much im not sure what need a id or not =( -->
<Span ID=UserID>
<Select Id=User name="User" style="width:260;height:25">
</Span>
</td>
</tr>
<tr>
<td>
<Input type=button name=btnListUsers value="List Users"
onclick="ListUsers()" style="width:250;height:25">
</td>
</tr>
</table>
</Form>
<SCRIPT LANGUAGE="javascript">
var serverURL = "FillSelectWithUsers.asp";
function ListUsers(){
var co = RSExecute(serverURL,"GetUsers");
myCallBack(co);
Quote:
}
function myCallBack(co){
//alert(co.return_value);
//This is my problem, my return_ value is a string of "<option
value="bla">What i want"<option value="bla2">another thing i want"
// How do i get this to insert into the select box??????
document.body.frm.UserID.insertAdjacentHTML = co.return_value;
Quote:
}
</Script>