[Zope] Checkboxes/SQL data type problem

Thomas B. Passin tpassin@mitretek.org
Thu, 20 Jun 2002 18:13:27 -0400


[Aseem Mohanty]
>
> The problem I had with that version, and the reason I had to go the
> roundabout way was that once I named it
> name=xxx:list ( <input type='hidden' name='deleted_users:list' value=''> )
> I could no longer use it in a javascript on the page.
>
> ...
> Hence I just decided to do it the dirty way. Any suggestions as to how
> to get around that problem.
>

You can still use javascript to access these elements.  If you know the
position of the input element in the form, you can use this style of syntax
to get to the exact element without needing its name:

document.forms[2].elements[3]

Also, you can still refer to these elements by name:

document.forms[1].elements['input1:list']

If there are more than one form elements named "input1:list", then the
expression will return a javascript array containing all the elements with
that name.

This works going back at least as far as Netscape 4.7, and probably farther
but I can't test that.  Works with IE and Mozilla as well.

If you need to distinguish these form elements by some unique string, give
them each a unique id attribute and use that to distinguish them.

Cheers,

Tom P