[Seaside] NAME attribute over-ride for dynamic HTML

Robert Hawley rhawley at plymouth.ac.uk
Fri Oct 22 22:17:27 CEST 2004

Hi Romain
Thank you; I didn't think of that. The Javascript seems to pick up on 'id' in the same way as 'name' (maybe one day I'll find out why) so I didn't have to use .getElementById explicitely in this case.  I still think that seaside could take account of the programmer naming - perhaps something I'll try to look at later.  Still, I'm happy for now - my code works!
Thanks again.


From: Romain Robbes [mailto:romain.robbes at lu.unisi.ch]
Sent: Fri 22-Oct-04 8:53 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: Re: [Seaside] NAME attribute over-ride for dynamic HTML 

        Hi Bob,

I think you can freely use the id attribute instead of the name one.
Then in javascript you can use document.getElementById(id) to access
the html element you need.


On Oct 22, 2004, at 5:53 AM, Robert Hawley wrote:

> I have been doing some dynamic HTML driven from seaside.  In order to
> be able to do things like animate web page components I have written
> JavaScript code that gets downloaded to the web page.  It works well
> and I can do things like drag an image around a web page and see it's
> coordinates changing. However, I have a problem that is to do with the
> way seaside allocates names to HTML components that makes scripting
> hard for getting the new coordinates back to the server.
> Seaside's naming is done behind the scenes and is subject to change
> whenever the programmer adds or removes components from the web page. 
> Seaside allocates names sequentially: <INPUT NAME="1"....> <INPUT
> NAME="2"....> etc..  If I use my own (meaningful) naming however, then
> both names are downloaded so currently I get things like <INPUT
> NAME="XPOSITION" NAME="1" ....> and in this little clash seaside wins!
>  Depending on seaside's naming convention could allow something of a
> work-around, but it is not a good solution because it is vulnerable to
> changes and it makes the JavaScript (even more) unreadable.
> It would be good if seaside could detect when the programmer has
> already set a 'name' attribute and use that name instead of the
> automatically generated one.
> I would welcome a 'fix' - or at least some advice on where to start
> looking.
> Yours
> Bob
> (Robert Hawley - Plymouth)
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside

More information about the Seaside mailing list