0
JScript error : Object expected.
New Here
,
/t5/dreamweaver-discussions/jscript-error-object-expected/td-p/664234
Apr 02, 2007
Apr 02, 2007
Copy link to clipboard
Copied
Hi,
Can someone please help me out here.
I am using asp javascript to develop my web page, i have the following function
defined in the head section of the page:
<head>
<script type="text/javascript">
function DisableSubGroup()
{
document.getElementById("SubGroupDD").disabled = "disabled";
}
</script>
</head>
I call the function from within my code in the following way.
<form action="CategoryListing.Mod.asp" method="post" name="SubForm" target="_self" id="SubForm">
<p>
<% if(ParentValue == String("Y"))
{
DisableSubGroup(); //Function call
}
%>
<select name="SubGroupDD" class="DefaultShortBox" id="SubGroupList" onchange="SubForm.submit()"
option selected= "<%Session("ActiveCategory")%>">
When i run it i get the following error every time..
Error Type:
Microsoft JScript runtime (0x800A138F)
Object expected
/DCASuppliersDatabase/CategoryListing.Mod.asp, line 218
What does it mean?
How do i get rid of it?
Regards
fifo
Can someone please help me out here.
I am using asp javascript to develop my web page, i have the following function
defined in the head section of the page:
<head>
<script type="text/javascript">
function DisableSubGroup()
{
document.getElementById("SubGroupDD").disabled = "disabled";
}
</script>
</head>
I call the function from within my code in the following way.
<form action="CategoryListing.Mod.asp" method="post" name="SubForm" target="_self" id="SubForm">
<p>
<% if(ParentValue == String("Y"))
{
DisableSubGroup(); //Function call
}
%>
<select name="SubGroupDD" class="DefaultShortBox" id="SubGroupList" onchange="SubForm.submit()"
option selected= "<%Session("ActiveCategory")%>">
When i run it i get the following error every time..
Error Type:
Microsoft JScript runtime (0x800A138F)
Object expected
/DCASuppliersDatabase/CategoryListing.Mod.asp, line 218
What does it mean?
How do i get rid of it?
Regards
fifo

TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664235#M193661
Apr 02, 2007
Apr 02, 2007
Copy link to clipboard
Copied
You cannot call client side functions on the server.
--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664236#M193662
Apr 02, 2007
Apr 02, 2007
Copy link to clipboard
Copied
fifo85 wrote:
> Hi,
>
> Can someone please help me out here.
> I am using asp javascript to develop my web page, i have the following function
> defined in the head section of the page:
>
> <head>
> <script type="text/javascript">
> function DisableSubGroup()
> {
> document.getElementById("SubGroupDD").disabled = "disabled";
> }
Normally the disabled property is Boolean
document.getElementById("SubGroupDD").disabled = true;
> </script>
> </head>
>
> I call the function from within my code in the following way.
>
> <form action="CategoryListing.Mod.asp" method="post" name="SubForm"
> target="_self" id="SubForm">
> <p>
> <% if(ParentValue == String("Y"))
> {
> DisableSubGroup(); //Function call
> }
> %>
I'm not a vb/asp person, but I imagine that you can only make the call
to the DisableSubGroup() function *after* the element is writtten to the
document.
> <select name="SubGroupDD" class="DefaultShortBox" id="SubGroupList"
> onchange="SubForm.submit()"
> option selected= "<%Session("ActiveCategory")%>">
You are missing the closing ">" from the select tag, and the opening "<"
from the option tag.
And "SubForm.submit()" should be:
"this.form.submit()"
or
"document.SubForm.submit()"
Mick
>
> When i run it i get the following error every time..
>
> Error Type:
> Microsoft JScript runtime (0x800A138F)
> Object expected
> /DCASuppliersDatabase/CategoryListing.Mod.asp, line 218
>
> What does it mean?
> How do i get rid of it?
> Regards
>
> fifo
>
>
> Hi,
>
> Can someone please help me out here.
> I am using asp javascript to develop my web page, i have the following function
> defined in the head section of the page:
>
> <head>
> <script type="text/javascript">
> function DisableSubGroup()
> {
> document.getElementById("SubGroupDD").disabled = "disabled";
> }
Normally the disabled property is Boolean
document.getElementById("SubGroupDD").disabled = true;
> </script>
> </head>
>
> I call the function from within my code in the following way.
>
> <form action="CategoryListing.Mod.asp" method="post" name="SubForm"
> target="_self" id="SubForm">
> <p>
> <% if(ParentValue == String("Y"))
> {
> DisableSubGroup(); //Function call
> }
> %>
I'm not a vb/asp person, but I imagine that you can only make the call
to the DisableSubGroup() function *after* the element is writtten to the
document.
> <select name="SubGroupDD" class="DefaultShortBox" id="SubGroupList"
> onchange="SubForm.submit()"
> option selected= "<%Session("ActiveCategory")%>">
You are missing the closing ">" from the select tag, and the opening "<"
from the option tag.
And "SubForm.submit()" should be:
"this.form.submit()"
or
"document.SubForm.submit()"
Mick
>
> When i run it i get the following error every time..
>
> Error Type:
> Microsoft JScript runtime (0x800A138F)
> Object expected
> /DCASuppliersDatabase/CategoryListing.Mod.asp, line 218
>
> What does it mean?
> How do i get rid of it?
> Regards
>
> fifo
>

>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664237#M193663
Apr 02, 2007
Apr 02, 2007
Copy link to clipboard
Copied
Julian Roberts wrote:
> You cannot call client side functions on the server.
>
<script>
<?php echo "x=".$_GET["var"] ?>
function foo(){
if(x && x=="bar"){
alert(x)
}
}
foo()
</script>
Mick
> You cannot call client side functions on the server.
>
<script>
<?php echo "x=".$_GET["var"] ?>
function foo(){
if(x && x=="bar"){
alert(x)
}
}
foo()
</script>
Mick
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664238#M193664
Apr 02, 2007
Apr 02, 2007
Copy link to clipboard
Copied
Yes, that's the way to do it. Execute the client-side code on
the client.
--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
fifo85
AUTHOR
New Here
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664239#M193665
Apr 03, 2007
Apr 03, 2007
Copy link to clipboard
Copied
Hi,
I have just tried the following code putting the script header to execute it on the client side:
<script>
if(ParentValue == String("Y"))
{
EnableSubGroup();
}
else
{
DisableSubGroup();
}
</script>
I do not get the object expected error anymore
but the functions don't work, why is this?
----Function definition ------
<script type="text/javascript">
function EnableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled='false';
}
function DisableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled='true';
}
</script>
I have just tried the following code putting the script header to execute it on the client side:
<script>
if(ParentValue == String("Y"))
{
EnableSubGroup();
}
else
{
DisableSubGroup();
}
</script>
I do not get the object expected error anymore
but the functions don't work, why is this?
----Function definition ------
<script type="text/javascript">
function EnableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled='false';
}
function DisableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled='true';
}
</script>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664240#M193666
Apr 03, 2007
Apr 03, 2007
Copy link to clipboard
Copied
fifo85 wrote:
> Hi,
>
> I have just tried the following code putting the script header to execute it
> on the client side:
> <script>
> if(ParentValue == String("Y"))
> {
> EnableSubGroup();
> }
> else
> {
> DisableSubGroup();
> }
> </script>
Where do you get "ParentValue" from?
String("Y") is redundant.
if(ParentValue == "Y")
>
> I do not get the object expected error anymore
> but the functions don't work, why is this?
>
> ----Function definition ------
> <script type="text/javascript">
> function EnableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled='false';
> }
document.forms["SubForm"].elements["SubGroupDD"].disabled=false;
There shoud be no quotes surrounding "false".
> function DisableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled='true';
> }
document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
> </script>
I think you're taking the wrong approach, if you are trying to disable a
form control depending on a server variable.
Mick
> Hi,
>
> I have just tried the following code putting the script header to execute it
> on the client side:
> <script>
> if(ParentValue == String("Y"))
> {
> EnableSubGroup();
> }
> else
> {
> DisableSubGroup();
> }
> </script>
Where do you get "ParentValue" from?
String("Y") is redundant.
if(ParentValue == "Y")
>
> I do not get the object expected error anymore
> but the functions don't work, why is this?
>
> ----Function definition ------
> <script type="text/javascript">
> function EnableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled='false';
> }
document.forms["SubForm"].elements["SubGroupDD"].disabled=false;
There shoud be no quotes surrounding "false".
> function DisableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled='true';
> }
document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
> </script>
I think you're taking the wrong approach, if you are trying to disable a
form control depending on a server variable.
Mick
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
fifo85
AUTHOR
New Here
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664241#M193667
Apr 04, 2007
Apr 04, 2007
Copy link to clipboard
Copied
Thanks for the response mick,
Parent value gets its value from the record set in the following code
var ParentValue = (rsGroups.Fields.Item("IsParent").Value);
in the server side code
then i use the code below to check its value
<script>
> if(ParentValue == String("Y"))
> {
> EnableSubGroup();
> }
> else
> {
> DisableSubGroup();
> }
> </script>
Whats wro ng with this?
Can't i do this?
What do you mean by server variable?
i didn't know that server and client variables have to be separate. Is this true?
thanks again
fifo
Parent value gets its value from the record set in the following code
var ParentValue = (rsGroups.Fields.Item("IsParent").Value);
in the server side code
then i use the code below to check its value
<script>
> if(ParentValue == String("Y"))
> {
> EnableSubGroup();
> }
> else
> {
> DisableSubGroup();
> }
> </script>
Whats wro ng with this?
Can't i do this?
What do you mean by server variable?
i didn't know that server and client variables have to be separate. Is this true?
thanks again
fifo
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664242#M193668
Apr 04, 2007
Apr 04, 2007
Copy link to clipboard
Copied
fifo85 wrote:
> Thanks for the response mick,
>
> Parent value gets its value from the record set in the following code
> var ParentValue = ();
> in the server side code
>
> then i use the code below to check its value
> <script>
> > if(ParentValue == String("Y"))
> > {
> > EnableSubGroup();
> > }
> > else
> > {
> > DisableSubGroup();
> > }
> > </script>
>
> Whats wro ng with this?
> Can't i do this?
> What do you mean by server variable?
> i didn't know that server and client variables have to be separate. Is this
> true?
Yes this is true. But you can use the server language to print the
javascript variable.
Pseudo server code:
<servertag>
print "<script> var ParentValue='"
print rsGroups.Fields.Item("IsParent").Value;
print "'</script>";
</servertag>
But show me what you have done so far.
Mick
>
> thanks again
>
> fifo
>
>
>
> Thanks for the response mick,
>
> Parent value gets its value from the record set in the following code
> var ParentValue = ();
> in the server side code
>
> then i use the code below to check its value
> <script>
> > if(ParentValue == String("Y"))
> > {
> > EnableSubGroup();
> > }
> > else
> > {
> > DisableSubGroup();
> > }
> > </script>
>
> Whats wro ng with this?
> Can't i do this?
> What do you mean by server variable?
> i didn't know that server and client variables have to be separate. Is this
> true?
Yes this is true. But you can use the server language to print the
javascript variable.
Pseudo server code:
<servertag>
print "<script> var ParentValue='"
print rsGroups.Fields.Item("IsParent").Value;
print "'</script>";
</servertag>
But show me what you have done so far.
Mick
>
> thanks again
>
> fifo
>
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
fifo85
AUTHOR
New Here
,
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664243#M193669
Apr 05, 2007
Apr 05, 2007
Copy link to clipboard
Copied
I have tried putting the following code along with my server
side code This time placing the script tag round the
function call This works sometimes and
sometimes it doesn't - strange!
<%
if(ParentValue != String("Y"))
{%>
<script>
DisableSubGroup();
</script>
<%}%>
<script type="text/javascript">
function DisableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
document.forms["SubGroupTFForm"].elements["SubGroupTF"].value =String("G");
document.getElementById("SubGroupDD").className = "GreyedShortBox";
}
</script>
function call This works sometimes and
sometimes it doesn't - strange!
<%
if(ParentValue != String("Y"))
{%>
<script>
DisableSubGroup();
</script>
<%}%>
<script type="text/javascript">
function DisableSubGroup()
{
document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
document.forms["SubGroupTFForm"].elements["SubGroupTF"].value =String("G");
document.getElementById("SubGroupDD").className = "GreyedShortBox";
}
</script>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/jscript-error-object-expected/m-p/664244#M193670
Apr 05, 2007
Apr 05, 2007
Copy link to clipboard
Copied
I need to see the whole page(source), fifo.
Mick
fifo85 wrote:
> I have tried putting the following code along with my server side code This
> time placing the script tag round the
> function call This works sometimes and
> sometimes it doesn't - strange!
> <%
> if(ParentValue != String("Y"))
> {%>
> <script>
> DisableSubGroup();
> </script>
> <%}%>
>
> <script type="text/javascript">
> function DisableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
> document.forms["SubGroupTFForm"].elements["SubGroupTF"].value =String("G");
> document.getElementById("SubGroupDD").className = "GreyedShortBox";
> }
> </script>
>
>
Mick
fifo85 wrote:
> I have tried putting the following code along with my server side code This
> time placing the script tag round the
> function call This works sometimes and
> sometimes it doesn't - strange!
> <%
> if(ParentValue != String("Y"))
> {%>
> <script>
> DisableSubGroup();
> </script>
> <%}%>
>
> <script type="text/javascript">
> function DisableSubGroup()
> {
> document.forms["SubForm"].elements["SubGroupDD"].disabled=true;
> document.forms["SubGroupTFForm"].elements["SubGroupTF"].value =String("G");
> document.getElementById("SubGroupDD").className = "GreyedShortBox";
> }
> </script>
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

