Forums

This topic is locked

Object Required error

Posted 23 Dec 2004 08:43:46
1
has voted
23 Dec 2004 08:43:46 Peter Kutuzov posted:
Greetings.

In the code below, I'm doing some simple validation, in a simple function. And, it works quite simply in an asp .NET page.

In a classic asp page, however, I get an object 'required error'. This doesn't occur until the actual onChange() event is fired.

Any ideas as to why it's throwing this one up?

Cheers,
Pharbo.

<pre id=code><font face=courier size=2 id=code>

&lt;script language="JavaScript" type="text/javascript"&gt;


function check() {

var strID;
strID = document.getElementById("txtUserID".value.toString();
strID = strID.substring(0,3);

if (strID == 'vir') {
if (navigator.appName.indexOf("Netscape" != -1) {
setStyle('login','visibility','hidden')
}else{
setStyle('Submit1','visibility','hidden')
}
setStyle('feedbackDiv','visibility' ,'visible')
}else{
if (navigator.appName.indexOf("Netscape" != -1) {
setStyle('login','visibility','visible')
}else{
setStyle('Submit1','visibility','visible')
}
setStyle('feedbackDiv','visibility','hidden')
}

}
//Function to set style

function setStyle(objId, style, value){
document.getElementById(objId).style[style]= value;
}

&lt;/script&gt;

</font id=code></pre id=code>

And this is where it's called...

<pre id=code><font face=courier size=2 id=code>

&lt;input type="text" class="fieldDataInput" value="" align="middle" style="width:135px;text-align:center;text-indent:0px;"
name="txtUserID" id="txtUserID" onchange="javascript:check()"&gt;

</font id=code></pre id=code>

Edited by - pharbo on 23 Dec 2004 08:44:35

Replies

Replied 24 Dec 2004 04:44:04
24 Dec 2004 04:44:04 Peter Kutuzov replied:
Don't worry about this, was solved eventually. I had variables named differently in the live company and the trial company. My fault.

Apologies if people tried to nut these things out.

Regards,
Peter

Reply to this topic