Subj : Re: [ URGENT ] JS error "missing ; before statement" To : netscape.public.mozilla.jseng From : Hannes Edinger Date : Tue Sep 16 2003 08:47 am thanks brendan, you are perfectly right - the error always occures, when the name of an input begins with a number. after i changed the routine which calculates the input-names everything worked fine. regards, hannes Brendan Eich wrote: > hannes.edinger@gmx.at wrote: > >> hello! >> >> i'm using mozilla 1.4 for linux (the "official" precompiled release), >> and i've a problem with a small javascript which is supposed to be >> executed after the onclick-event of a checkbox. >> >> that's the part of the html-code where the error occures: >> [-- cut --] >> >> > onClick="this.form.0ae48c0f5f12c04250879948ad6679dc.value=(this.checked)?'1':'0';"/> >> > > > > JS identifiers cannot start with a numeric character. In a property > reference such as form.x, x must be an identifier, lexically. To > reference a property not named by a lexical identifier, use subscripting: > > onClick="this.form['0ae48c0f5f12c04250879948ad6679dc'].value=(this.checked)?'1':'0';"/> > > >> the html-code is server-generated and the routine which creates the >> checkbox and the hidden input is used in many other cases where the >> generated code works properly. > > > > Does the generated identifier always start with a numeric character such > as '0', as shown above? What about the > "dummy0ae48c0f5f12c04250879948ad6679dc" id? That's a valid lexical > identifier, and so should all others that the server code generates. > Can you fix the server code? > >> >> the generated code always works pretty fine in other browsers. > > > > I greatly doubt that. > > /be > .