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!

Object Expected: Javascript/HTML

Status
Not open for further replies.

MrsMopey

Programmer
Jul 31, 2007
19
Hello,
I keep getting the error "Object Expected: Line 28 Char 1". That line is my button line ("BUTTON ONCLICK= "Connect") I've checked everything I could think of, but it's still not rendering correctly. I need some more eyes to see what I don't

Code:
[COLOR=blue]

<!--      Title: Reset SX User Intranet Page
Created by: Rayna Oesterreicher~ Senior Programmer, Volm Companies
Date Created: 06/24/2008
Purpose: The page allows for remote access to a telnet session to run a 'shutuser' command housed on the RS6000 box. The company number
is 4 digits long and the user id is two characters long. There is a disconnect button incase multiple user's must be unlocked.
-->
<html>
    <head>
        <title>ResetPage</title>
    </head>

    <body >
        <object classid= "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" viewastext>
                <param name="LPKPath" value="wodTelnetDLX.lpk"></object>
            <!--this is to be used once the component is activated/liscensed, cost is $199<object classid= "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" viewastext>
        <param name="LPKPath" value="wodTelnetDLX.lpk">
        </object>-->

        <form name="myform">
        <font face="Goudy Old Style" size="6">
            <h1 font size="4" align = "center">Volm Companies Intranet</h1>
                <hr size="1" color="#707070">
                <table border = "1" align= "center" cellpadding = "10" width="75%">
                    <tr>
                        <th colspan= "3">Reset SX User ID</th>
                    </tr>
                    <tr>
                        <td width= "15%"><input size="20" type= BUTTON ONCLICK="Connect()" value="Connect"></td>
                        <td width= "20%"><LABEL for ="textResult">Connection Status</LABEL></td>
                        <td width= "40%"><input size="50" type="text" name="textResult" value=""readonly background-color:CCCCFF></td>
                    </tr>
                    <tr font size = "2">
                        <td colspan= "3">Click the connect button to connect to the SX server</td>
                    </tr>
                    <tr font size = "3">
                        <td colspan= "3"rowspan="1">You can reset your user ID by using the &nbsp &nbsp<FONT SIZE = "5"><b>shutuser</b></FONT> &nbsp &nbsp
                                                                                command. You must enter your user ID and company number in the following format:
                        </td>
                    </tr>
                    <tr><td><b>Example 1</b></td><td colspan="2" align= "center"><b>SHUTUSER 0001ABC</b></td></tr>
                    <tr><td><b>Example 2</b></td><td colspan="2" align= "center"><b>SHUTUSER 0020XYZ</b></td></tr>
                </table>
        </form>
    </body>
    <script language = "text/javascript">
        with (telnetdlx)
        {
            TerminalEmulation = 1; //use VT1000 Emulation
            AutoSize = true; //resize to fit
        }

        function Connect()
        {
            with (document.myform)
            {
                if (telnetdlx.State ==0)
                {
                    //connect
                    telnetdlx.Connect ("hostserver","23","Telnet");
                    telnetdlx.Login= "login";
                    telnetdlx.Password = "password";
                    //telnetdlx.Command = "shutuser" + ddCoNo.value + textUInit.value + ";
                }
                else
                {
                    //disconnect
                    Telnetdlx.Disconnect();
                }//if
            }//with
        }//function
    </script>
    <script for= "telnetdlx" event = "statechange()" language= "JavaScript">
        document.myform.textResult.value = telnetdlx.StateText(telnetdlx.State);
    </script>
</html>
[/color]
 
><script language = "text/javascript">
[tt]<script [red]type[/red] = "text/javascript">[/tt]

><input size="50" type="text" name="textResult" value=""readonly background-color:CCCCFF>
[tt]<input size="50" type="text" name="textResult" value="" readonly style="background-color:#CCCCFF">[/tt]
 
tsumji,
I did change that line, but I still get the same error message. In addition I get another message:

[COLOR=green yellow]Line 46 Char 5 telnetdlx is not declared[/color]

Code:
[COLOR=blue]
	[COLOR=red]<script type = "text/javascript">[/color]
	dim telnetdlx;
	with (telnetdlx)
		{
			TerminalEmulation = 1; //use VT1000 Emulation
			AutoSize = true; //resize to fit
		}

		function Connect()
		{
			with (document.myform)
			{
				if (telnetdlx.State ==0)
				{
					//connect
					telnetdlx.Connect ("volmrs","23","Telnet");
					telnetdlx.Login= "root";
					telnetdlx.Password = "mci";
					//telnetdlx.Command = "shutuser" + ddCoNo.value + textUInit.value + ";
				}
				else
				{
					//disconnect
					Telnetdlx.Disconnect();
				}//if
			}//with
		}//function
	</script>
	<script for= "telnetdlx" event = "statechange()" language= "JavaScript">
		document.myform.textResult.value = telnetdlx.StateText(telnetdlx.State);
	</script>
</html>[/color]
 
An activex component is being used. The object points to LPK (licence) file, understood to be installed on the users system already. That's fine. However, you need the workhorse component actually load up, something like:
[tt] <object id="telnetdlx" classid="..." codebase="..."></object">[/tt]
You have to determine those unfilled data from the manufacturer (wdo). On that, I cannot help. You've to check out with them.
If the script is yours, you should know better.

Another small problem on this line.
>Telnetdlx.Disconnect();
[tt]telnetdlx.Disconnect();[/tt]
 
This
Code:
dim telnetdlx;
is VBScript, not Javascript. That does NOT define telnetdlx.

Try
Code:
var telnetdlx;

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top