"form_for" names fields using brackets = javascript problems

The "form_for" helper and its friends "text_field_for" etc generate form
fields with names like "forum[title]", i.e. using square brackets to
denote attributes on model objects.

Now, for the convenience of the user I want to do some simple
client-side validation to check that some fields have been filled in. So
I am trying to write javascript like

"if (myForm.forum[title].value == '') { return false; }",

myForm.elements['forum[title]'].value

-philip