I’m getting an “object does not support this property or method” error on this line AFTER I click the button.
document.getElementById(“txtNewOwner”).value = document.getElementByID(“cboExpertID”).value;
Below is the rest of the code. Anyone know what causes this error or why it might be occuring? Thanks.
[CODE]
<!–#includes file=”header.asp”–>
<head>
<title>Untitled Document</title>
</head>
<body>
<%
‘Declare variables
Dim CN, RS, RSExpert, vSQLJoin
Dim vCaseNumber, vNewAreaExpertiseID, vNewExpertID
‘GetDataConnection lives in the header file
Set CN = GetDataConnection
If Request.Form(“cboCaseNumber”) <> “” Then
vCaseNumber = stripquotes(Request.Form(“cboCaseNumber”))
End If
If Request.Form(“cboAreaExpertiseID”) <> “” Then
vNewAreaExpertiseID = stripquotes(Request.Form(“cboAreaExpertiseID”))
End If
If Request.Form(“cboExpertID”) <> “” Then
vNewExpertID = stripquotes(Request.Form(“cboExpertID”))
End If
%>
<form name=”frmResearch” id=”frmResearch” method=”post”>
<!– Reassign Case –>
<table width=”99%” border=”0″ cellspacing=”2″ cellpadding=”2″>
<tbody id=”tblReassign” name= “tblReassign”>
<tr>
<td><h4>Reassign Case</h4></td>
</tr>
<tr>
<td>
<p>Select Area of Expertise:</p>
<p>
<select name=”cboAreaExpertiseID” id=”cboAreaExpertiseID” onChange=”displayArea(this);”>
<option></option>
<%
Set RS = CN.Execute (“Select AreaExpertiseID, Area From FRAreaExpertise Order By Area ASC”)
If Not RS.EOF Then
Do While Not RS.EOF
%>
<option value='<%= RS.Fields(“AreaExpertiseID”)%>'<%If vNewAreaExpertiseID = stripquotes(RS.Fields(“AreaExpertiseID”)) Then Response.Write “selected” %>><%= RS.Fields(“Area”)%></option>
<%
‘Get next record
RS.MoveNext
Loop
End If
%>
</select>
</p></td>
</tr>
</table>
<table width=”99%” border=”0″ cellspacing=”2″ cellpadding=”2″>
<tbody id=”tblExperts” name= “tblExperts” style=”display: <%If vNewAreaExpertiseID = “” Then Response.Write “none”%>”>
<tr>
<td><p>Select Researcher:</p>
<p>
<select name=”cboExpertID” id=”cboExpertID”>
<option></option>
<%
If vNewAreaExpertiseID <> “” Then
‘Select experts and limit the number of cases experts are allowed.
Set RSExpert = CN.Execute (“spFRSelectExperts ‘” & vNewAreaExpertiseID & “‘”)
If Not RSExpert.EOF Then
Do While Not RSExpert.EOF
‘IsMaxedOut is the column that stores whether or not a particular expert has exceeded the maximum cases allowed.
If RSExpert.Fields(“IsMaxedOut”) = 1 Then
%>
<option value=’-1′ disabled <%If vNewAreaExpertiseID = stripquotes(RSExpert.Fields(“AreaExpertiseID”)) Then Response.Write “selected” %>><%= RSExpert.Fields(“ExpertLastName”)%>, <%= RSExpert.Fields(“ExpertFirstName”)%></option>
<%
Else
%>
<option value='<%= RSExpert.Fields(“ExpertID”)%>’><%= RSExpert.Fields(“ExpertLastName”)%>, <%= RSExpert.Fields(“ExpertFirstName”)%></option>
<%
End If
‘Get Next Record
RSExpert.MoveNext
Loop
End If
End If
%>
</select>
<input name=”txtNewOwner” type=”text” value=”‘<%= vNewExpertID %>'”></p>
<p>
<input type=”submit” class= “button” onClick=”verifyReassignment();” value=”Reassign Case”>
</p>
</td>
</tr>
</tbody>
</table>
</form>
<%
‘Close objects
Set RS = Nothing
Set RSExpert = Nothing
CN.CLose
Set CN = Nothing
%>
</body>
<script language=”javascript”>
//Display comb box to select area of expertise.
function displayArea(obj)
{
var area = obj.options[obj.selectedIndex].value;
var submitForm = document.getElementById(“frmResearch”);
if ( area != “” )
{
document.getElementById(“tblExperts”).style.display = “”;
}
else
{
document.getElementById(“tblExperts”).style.display = “none”;
}
submitForm.submit();
}
function verifyReassignment()
{
var answer = confirm(“Are you sure you want to reassign this case?”);
var submitReassignment = document.getElementById(“frmResearch”);
if (answer)
{
alert(document.getElementById(“cboExpertID”).value);
document.getElementById(“txtNewOwner”).value = document.getElementByID(“cboExpertID”).value;
alert(“This case has been reassigned.”);
submitReassignment.action = “ip_resources_research_post.asp”;
submitReassignment.submit();
}
else
{
alert(“Case will not be reassigned.”)
}
}
</script>
</html>