Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'options' is not an object

Status
Not open for further replies.

tyne

Programmer
May 18, 2001
4
GB
i get the above error message with the following code can anyone help as i am a beginner chucked in at the deep end and i am struggling! (greatly)?
function addemployee(targ, selObj){
eval(targ+&quot;.location='AssignLMStatus.asp?EmployeeNo=&quot; + selObj.options[selObj.selectedIndex].value + &quot;&update=true&assign=true + <%=RS2(&quot;LineManager&quot;)%>'&quot;);
}
***the above code is used to refresh the page and pass items on the querystring***

<input type =&quot;button&quot; value=&quot;>>&quot; ALIGN=&quot;TOP&quot; onclick=&quot;addemployee('this' , 'Employees4Team')&quot;>
*** the above code is the input button that i click to make the function work*******

LineNo=request.querystring(&quot;LineManager&quot;)
update=request.querystring(&quot;Update&quot;)

If Update=&quot;true&quot; then
strSQL1 =&quot;Update employee set &quot;
strSQL1 = strSQL1 & &quot;LineManager=&quot; & LineNo
strSQL1 = strSQL1 & &quot; Where EmployeeNo=&quot; & EmpNo

set RS7 = MyConn.Execute(strSQL1)
End if
****the above code is what i use to update the database****

<Select name =&quot;Employees4Team&quot; SIZE=10 MULTIPLE
<OPTION VALUE=&quot;&quot;SELECTED></OPTION>
<% ON ERROR RESUME NEXT
RS4.MOVEFIRST
DO WHILE NOT (RS4.EOF)
%>
<OPTION VALUE=&quot;<%=RS4(&quot;employeeno&quot;)%>&quot; Name=&quot;<%=RS4(&quot;employeeno&quot;)%>&quot;><%=RS4(&quot;firstname&quot;)%>  <%=RS4(&quot;surname&quot;)%></OPTION>
<%
RS4.MOVENEXT
LOOP
RS4.CLOSE
%>
</select>
****the above code is the dropdown list with names******

************************************************************
what i am trying to do is select a name out of the dropdown box click on the add button refresh the page so that the name will be put into a second box. when i click on the add button the error message 'options' is not an object is displayed in the javascript part. please help if you can. it's driving me crazy.

thanks.
 
Any chance of the full page coding please tyne?

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
<%@ Language= VBScript%>
<%
'set up the connection object if not already connected

Set Myconn = Server.CreateObject(&quot;ADODB.Connection&quot;)

'Connect to ODBC Source
MyConn.Open &quot;timesheet&quot;

UserNo=request.cookies(&quot;UserID&quot;)(&quot;EmpNo&quot;)

If request.querystring=&quot;&quot; then
EmpNo=1
End If

assign=request.querystring(&quot;assign&quot;)




Set RS=MyConn.Execute(&quot;Select EmployeeNo, Firstname, Surname, LineManager from employee where LineManagerStatus=FALSE&quot;)


If request.querystring <>&quot;&quot; then

EmpNo=request.querystring(&quot;EmployeeNo&quot;)
updatecheck=request.querystring(&quot;update&quot;)

If updatecheck = &quot;true&quot; then

strSQL = &quot;update employee set&quot;
strSQL = strSQL & &quot; LineManagerStatus=true &quot;
strSQL = strSQL & &quot;WHERE EmployeeNo=&quot; & EmpNo

Set RS6 = MyConn.Execute(strSQL)
End If
End If




Set RS2=MyConn.Execute(&quot;Select EmployeeNo, FirstName, Surname, LineManager from employee where EmployeeNo=&quot; & EmpNo)
Set RS3=MyConn.Execute(&quot;Select FirstName, Surname from employee where EmployeeNo=&quot; & RS2(&quot;LineManager&quot;))
Set RS4=MyConn.Execute(&quot;Select EmployeeNo, FirstName, Surname from Employee where EmployeeNo<>&quot; & RS2(&quot;EmployeeNo&quot;))
Set RS5=MyConn.Execute(&quot;Select EmployeeNo, FirstName, Surname from Employee where EmployeeNo=&quot; & RS2(&quot;LineManager&quot;))

%>

<HTML>
<HEAD>
<TITLE>Line Manager Administration Screen</TITLE>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function jump_menu(targ, selObj){
eval(targ+&quot;.location='AssignLMStatus.asp?EmployeeNo=&quot; + selObj.options[selObj.selectedIndex].value + &quot;'&quot;);
}
function AssignStatus(targ, selObj){
eval(targ+&quot;.location='AssignLMStatus.asp?EmployeeNo=&quot; + <%=RS2(&quot;EmployeeNo&quot;)%> + &quot;&update=true&assign=true'&quot;);
}
function addemployee(targ, selObj){
eval(targ+&quot;.location='AssignLMStatus.asp?EmployeeNo=&quot; + selObj.options[selObj.selectedIndex].value + &quot;&update=true&assign=true + <%=RS2(&quot;LineManager&quot;)%>'&quot;);
}
</SCRIPT>


</HEAD>
<BODY BGCOLOR=&quot;#FFFFFF&quot; BACKGROUND=&quot;pagebackground.jpg&quot;>
<DIV ALIGN=&quot;Center&quot;> </DIV>
<P ALIGN=&quot;Center&quot;><I><B><FONT COLOR=&quot;#336600&quot; SIZE=&quot;5&quot;>Assign LineManager Status</FONT></B></I></P>
<TABLE WIDTH=&quot;100%&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;10&quot; CELLSPACING=&quot;0&quot;>
<TR>
<TD>
<TABLE WIDTH=&quot;100%&quot; CELLPADDING=&quot;5&quot; BORDER=&quot;0&quot; ALIGN=&quot;center&quot;>
</TR>

<TR VALIGN=&quot;top&quot;>
<TD align=center>
<form>
<Select name =&quot;NonLineManagers&quot; onChange=&quot;jump_menu('this', this)&quot;>
<OPTION VALUE=&quot;&quot;SELECTED></OPTION>
<% ON ERROR RESUME NEXT
RS.MOVEFIRST
DO WHILE NOT (RS.EOF)
%>

<OPTION VALUE =&quot;<%=RS(&quot;employeeno&quot;)%>&quot; Name=&quot;<%=RS(&quot;employeeno&quot;)%>&quot;><%=RS(&quot;firstname&quot;)%>  <%=RS(&quot;surname&quot;)%></OPTION>

<%
RS.MOVENEXT
LOOP
RS.CLOSE
%>
</select>
</form>
</TD>
</TR>

<TR>
<TD><TABLE WIDTH= 100% COLSPAN= 8 CELLPADDING=1 BORDER= 0 CELLSPACING= 1 ALIGN=&quot;center&quot;>


<TD ALIGN=&quot;Center&quot; BGCOLOR=&quot;336600&quot; WIDTH=&quot;15%&quot;><FONT FACE=&quot;Arial, Helvetica, Sans-Serif&quot; COLOR=&quot;#ffffff&quot; SIZE=&quot;2&quot;> <B>EMPLOYEE NO</B></FONT></TD>

<TD ALIGN=&quot;Center&quot; BGCOLOR=&quot;336600&quot; WIDTH=15%><FONT FACE=&quot;Arial, Helvetica, Sans-Serif&quot; COLOR=&quot;#ffffff&quot; SIZE=&quot;2&quot;> <B>FIRSTNAME</B></FONT></TD>

<TD ALIGN=&quot;Center&quot; BGCOLOR=&quot;336600&quot; WIDTH=15%><FONT FACE=&quot;Arial, Helvetica, Sans-Serif&quot; COLOR=&quot;#ffffff&quot; SIZE=&quot;2&quot;> <B>SURNAME</B></FONT></TD>

<TD ALIGN=&quot;Center&quot; BGCOLOR=&quot;336600&quot; WIDTH=15%><FONT FACE=&quot;Arial, Helvetica, Sans-Serif&quot; COLOR=&quot;#ffffff&quot; SIZE=&quot;2&quot;> <B>DEPARTMENT</B></FONT></TD>

<TD ALIGN=&quot;Center&quot; BGCOLOR=&quot;336600&quot; WIDTH=15%><FONT FACE=&quot;Arial, Helvetica, Sans-Serif&quot; COLOR=&quot;#ffffff&quot; SIZE=&quot;2&quot;> <B>LINE MANAGER</B></FONT></TD>

</TR>

<TR BGCOLOR=&quot;#ECFFEC&quot;>
<TD ALIGN=&quot;Center&quot; WIDTH=15%><FONT FACE=&quot;Arial Helvetica, Sans-Serif&quot; SIZE=&quot;2&quot;> <%=RS2(&quot;employeeno&quot;)%></FONT></TD>

<TD ALIGN=&quot;Center&quot; WIDTH=15%><FONT FACE=&quot;Arial Helvetica, Sans-Serif&quot; SIZE=&quot;2&quot;> <%=RS2(&quot;Firstname&quot;)%></FONT></TD>

<TD ALIGN=&quot;Center&quot; WIDTH=15%><FONT FACE=&quot;Arial Helvetica, Sans-Serif&quot; SIZE=&quot;2&quot;> <%=RS2(&quot;Surname&quot;)%></FONT></TD>

<TD ALIGN=&quot;Center&quot; WIDTH=15%><FONT FACE=&quot;Arial Helvetica, Sans-Serif&quot; SIZE=&quot;2&quot;> <%=RS2(&quot;Department&quot;)%></FONT></TD>

<TD ALIGN=&quot;Center&quot; WIDTH=15%><FONT FACE=&quot;Arial Helvetica, Sans-Serif&quot; SIZE=&quot;2&quot;> <%=RS3(&quot;firstname&quot;)%>  <%=RS3(&quot;surname&quot;)%></FONT></TD>

</TR>
</table>
</TD>
</TR>
</TABLE>
</TABLE>
<TABLE WIDTH=&quot;100%&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;50&quot; CELLSPACING=&quot;0&quot;>
<TR><ROWSPAN=20>
<TD>
<TABLE WIDTH=&quot;0%&quot; BORDER=&quot;1&quot; ALIGN=&quot;Center&quot;>
<TR VALIGN=&quot;TOP&quot;>
<form>
<INPUT TYPE=&quot;button&quot; value=&quot;ASSIGN LM STATUS&quot; ONCLICK=&quot;AssignStatus('this', this)&quot;>
</form>
</TR>
</TD>
</TR>
</TABLE>

<TR VALIGN=&quot;top&quot;>
<TABLE WIDTH=&quot;100%&quot; BORDER=&quot;0&quot; CELLPADDING=&quot;100&quot; CELLSPACING=&quot;0&quot;>
<TR>
<TD align=&quot;left&quot; WIDTH=&quot;45%&quot; valign=&quot;top&quot;>

<form>
<%if assign=&quot;true&quot; then%>
<Select name =&quot;Employees4Team&quot; SIZE=10 MULTIPLE
<OPTION VALUE=&quot;&quot;SELECTED></OPTION>
<% ON ERROR RESUME NEXT
RS4.MOVEFIRST
DO WHILE NOT (RS4.EOF)
%>
<OPTION VALUE=&quot;<%=RS4(&quot;employeeno&quot;)%>&quot; Name=&quot;<%=RS4(&quot;employeeno&quot;)%>&quot;><%=RS4(&quot;firstname&quot;)%>  <%=RS4(&quot;surname&quot;)%></OPTION>
<%
RS4.MOVENEXT
LOOP
RS4.CLOSE
%>
</select>



</td>
</form>

<td WIDTH=&quot;10%&quot; VALIGN=&quot;MIDDLE&quot; >

<ALIGN=&quot;MIDDLE&quot;><I><B><FONT COLOR=&quot;#336600&quot; SIZE=&quot;2&quot;>Add</FONT></B></I>
<input type =&quot;button&quot; value=&quot;>>&quot; ALIGN=&quot;TOP&quot; onclick=&quot;addemployee('this' , 'Employees4Team')&quot;>
<ALIGN=&quot;middle&quot;><I><B><FONT COLOR=&quot;#336600&quot; SIZE=&quot;2&quot;>Remove</FONT></B></I>
<INPUT TYPE=&quot;button&quot; VALUE=&quot;<<&quot; ALIGN=&quot;BoTTOm&quot; onclick=&quot;addemployee&quot;>
</td>


</FORM>
<form>
<td align=&quot;right&quot; WIDTH=&quot;45%&quot; cellPADDING=&quot;50&quot; valign=&quot;top&quot;>

<Select name =&quot;assembledTeam&quot; SIZE=10 MULTIPLE>
<OPTION VALUE=&quot;&quot;SELECTED></OPTION>
<% ON ERROR RESUME NEXT
RS5.MOVEFIRST
DO WHILE NOT (RS5.EOF)
%>
<OPTION VALUE=&quot;<%=RS5(&quot;employeeno&quot;)%>&quot;
Name=&quot;<%=RS5(&quot;employeeno&quot;)%>&quot;><%=RS5(&quot;firstname&quot;)%>  <%=RS5(&quot;surname&quot;)%></OPTION>
<%
RS5.MOVENEXT
LOOP
RS5.CLOSE
%>
</select>
<%end if%>
</td>
</form>

</TR>
</Table>

</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top