From: Leif W <war...@us...> - 2003-09-04 19:34:54
|
----- Original Message ----- From: <ml...@id...> To: <dyn...@li...> Sent: Thursday, September 04, 2003 3:16 PM Subject: Re: [Dynapi-Help] 3x api and text boxes - semi solved > > I did some more checking. > > 1) all of the text boxes had the same element name > 2) using getElm() on the HTMLTextBox, returned the same object [as by > '=='] on all of the textbox's with the same name. > > 3) changing the names to be relatively unique, solved the problem. > > My list boxes just happened to have different element names. > > -- > > I think this is a problem, because it becomes hard to make 'widgets' > that can be replicated on the page, if the element names have to be > unique. I think this is the same for most browsers and HTML in general. How is a browser supposed to distinguish one element from another if they all have the same name? It can't. When the form is submitted to a server, how is the server side supposed to know about mutiple values assigned to the same name? It can't. Generally speaking, but you can do it in Perl - sometimes. Likewise with the DynAPI, if all DynLayers had the same name, then the API wouldn't work. That's why the API automagically assigns unique names to each DynLayer. Something like this would have to be implemented if you want to have automatic generation of unique names for form elements, or just keep track of them manually in the code. It's difficult to understand the problem without an example, though. Leif |