JAPIO wrote:
[color=blue]
> Each image will represent an field in a database.
> When one image is clicked the image source will be changed and a update
> request will be send to the database (probably a iframe location
> refresh somewhere).
> So i need the id to update the field which it belongs too.[/color]
But if you have server side code and that stuff comes from a data base
then you should easily be able to generate the ids on the server, there
is certainly no need to to it "manually" as your first post said.
Of course you can loop through all images on the client and generate ids
there ( e.g.
var images = document.images, length = images.length;
for (var i = 0; i < length; i++) {
images[i].id = 'image' + i;
}
) but I don't see how that helps then to get the ids necessary to relate
to your data base fields, that is information you have available on the
server and consequently you should simply generate the needed ids there.
--
Martin Honnen
http://JavaScript.FAQTs.com/