I never put in a name attribute, that could be part of the problem. I solved it by putting it in a function that's called by onclick, and it worked. I was able to reference it the old fashioned JS way, and prototype's way.
Now all I want to know is how to load and parse a JSON file using the same method. Thanks! Eugene On Sat, Nov 7, 2009 at 1:45 PM, kstubs <[email protected]> wrote: > > Try naming the ID attribute different than the NAME attribute. > > On Nov 7, 12:49 pm, bill <[email protected]> wrote: > > Eugene Hourany wrote: > > > Hi all, > > > > > I'm tearing my hair out trying to figure out why I keep getting a > > > "element is null" error. Here's what my code looks like: > > > > > $('firstname').hide(); > > > > > and I have > > > > > <input id="firstname" name="firstname" value="" /> > > > > > and I get > > > > > Error: $("firstname") is null > > > Source File: > > > file:///C:/Documents%20and%20Settings/142253/Desktop/test/index.html# > > > Line: 14 > > > > > I'm doing this locally from my desktop. I'm using prototype 1.6.1. > > > > do you have the input declaration before the execution of the > > "$('firstname').hide();" > > > > If you execute the js before the input is declared, the id will not > exist. > > > > bill > > > > -- > > Bill Drescher > > william {at} TechServSys {dot} com > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
