By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,520 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,520 IT Pros & Developers. It's quick & easy.

Funtion Problem

P: n/a
I'm getting an error "Object doesn't support this property or method."
Help appreciated.

<html>
<head>
<script type="text/javascript">
function showtable(){
var myform1 = document.form1;
if(myform1.T1.value=="Size Mix")
{
document.getElementByID("Table1").style.visibility ="hidden"
}
}

</script>

</head>

<body onLoad= "showtable()">
<form name=form1><input type="text" name="T1" value="Size Mix">
<table border="1" id="Table1" width="100%">

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 11 Feb 2004 18:49:13 GMT, Steve Bishop <st****@viper.com> wrote:

[snip]
<script type="text/javascript">
function showtable(){
var myform1 = document.form1;
if(myform1.T1.value=="Size Mix")
{
document.getElementByID("Table1").style.visibility ="hidden"
}
}

</script>


[snip]

Why are you asking this question again? If my solution, or Mr Cornford's,
was not sufficient, you should have followed up with more information or a
clarification. You state above, like you did last time, saying that you
get a error, but you don't indicate on which line above that error is
supposed to have occurred.

I told you this last time, and I'll tell you again: JavaScript is
case-sensitive. The method name is "getElementById", NOT "getElementByID"
(notice the uppercase "D").

If this doesn't solve the problem, give us more information not a third,
identical post.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2

P: n/a
In article <40*********************@news.frii.net>, st****@viper.com
enlightened us with...
I'm getting an error "Object doesn't support this property or method."
{
document.getElementByID("Table1").style.visibility ="hidden"


document.getElementById("Table1").style.visibility ="hidden"
^^
case-sensitive

Oh, and the script as a whole isn't cross-browser nor does it degrade
cleanly (so that old browsers don't crash, they just don't do anything).
I sure hope this is not for a production-quality website.

--
--
~kaeli~
A lot of money is tainted - It taint yours and it taint mine.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.