Funtion Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Bishop

    Funtion Problem

    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.v alue=="Size Mix")
    {
    document.getEle mentByID("Table 1").style.visib ility="hidden"
    }
    }

    </script>

    </head>

    <body onLoad= "showtable( )">
    <form name=form1><inp ut 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!
  • Michael Winter

    #2
    Re: Funtion Problem

    On 11 Feb 2004 18:49:13 GMT, Steve Bishop <steveb@viper.c om> wrote:

    [snip]
    [color=blue]
    > <script type="text/javascript">
    > function showtable(){
    > var myform1 = document.form1;
    > if(myform1.T1.v alue=="Size Mix")
    > {
    > document.getEle mentByID("Table 1").style.visib ility="hidden"
    > }
    > }
    >
    > </script>[/color]

    [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.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • kaeli

      #3
      Re: Funtion Problem

      In article <402a7928$0$202 $75868355@news. frii.net>, steveb@viper.co m
      enlightened us with...[color=blue]
      > I'm getting an error "Object doesn't support this property or method."
      > {
      > document.getEle mentByID("Table 1").style.visib ility="hidden"[/color]

      document.getEle mentById("Table 1").style.visib ility="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.



      Comment

      Working...