Funtion Problem

Discussion in 'Javascript' started by Steve Bishop, Feb 11, 2004.

  1. Steve Bishop

    Steve Bishop Guest

    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!
    Steve Bishop, Feb 11, 2004
    #1
    1. Advertising

  2. On 11 Feb 2004 18:49:13 GMT, Steve Bishop <> 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
    d (replace ".invalid" with ".uk" to reply)
    Michael Winter, Feb 11, 2004
    #2
    1. Advertising

  3. Steve Bishop

    kaeli Guest

    In article <402a7928$0$202$>,
    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
    kaeli, Feb 11, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam Holden

    Re: fraction reducing funtion

    Sam Holden, Aug 3, 2003, in forum: C++
    Replies:
    2
    Views:
    366
    Sam Holden
    Aug 4, 2003
  2. garyolsen

    Virtual Funtion Questions

    garyolsen, Dec 2, 2003, in forum: C++
    Replies:
    3
    Views:
    1,211
    jeffc
    Dec 2, 2003
  3. Guest
    Replies:
    6
    Views:
    2,698
    Siemel Naran
    Jul 15, 2004
  4. athiane
    Replies:
    13
    Views:
    516
    Netocrat
    Mar 11, 2006
  5. Lee Xuzhang
    Replies:
    5
    Views:
    332
    Kevin D. Quitt
    Jun 14, 2006
Loading...

Share This Page