[thelist] javascript error turning brain to mush (checkbox toggles)

.jeff jeff at members.evolt.org
Thu Jan 30 18:38:01 CST 2003


joe,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Joe Lance
>
> I think your problem is the white space in the call to
> the toggleall function onclick=toggleAll(this.form) When
> I removed the white space it worked like a champ for me.
>
> > <input type="button" name="toggle_tracks"
> >        value="toggle tracks"
> >        onclick=toggleAll( this.form )
> >        class="search_input_submit"></input>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

it's not the whitespace on its own.  it's the combination of the whitespace
and the onclick event handler value not being wrapped in quotes.  add quotes
around it and it should work regardless of white space:

<input type="button" name="toggle_tracks"
       value="toggle tracks"
       onclick="toggleAll( this.form )"
       class="search_input_submit"></input>

fwiw, i'd recommend against using a close </input> tag to make your code
xhtml compliant.  instead, just toss on a closing slash:

<input type="button" name="toggle_tracks"
       value="toggle tracks"
       onclick="toggleAll( this.form )"
       class="search_input_submit" />

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list