Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
11-30-2006, 11:44 PM #1
i am using the color selector from http://www.dynamicdrive.com/dynamici...cker/index.htm
and have com across a problem, if you use the color selector it fills a color box next to the text field, i would like it to fill that box and also another one on the same page, but after i add another div with the same ID it doesn't load the second one as well, but if i delete the first one the second one starts working, is there a way i can make the 2 color box's work simultaneously?
thanks for any help
12-01-2006, 03:01 AM #2
- Join Date
- Oct 2003
- on a ship
- Thanked 6 Times in 5 Posts
it doesnt work because the script probably calls to the element by id. and the first elemement it sees with that specific id is the only one it will change. you will haveto add in another line to specify the second div (give it a different id).
I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.
12-01-2006, 09:32 AM #3
- Join Date
- Apr 2003
- Bucharest, ROMANIA
- Thanked 379 Times in 375 Posts
id must be unique on the same page/session. Give another id to your second element , and (not an elegant method, but it allows you to avoid modify the code) repeat the called function passing that id as parameter:
onfocus="ddcolorposter.echocolor(this, 'colorbox1');ddcolorposter.echocolor(this, 'colorotherbox1')"
12-02-2006, 07:18 AM #4
thanks for the help guys,
it only changes the last ddcolorposter command, so wateva colorbox is last thats what changes.
is there any other way to do this without changing the main code?
Last edited by Baleric; 12-02-2006 at 07:21 AM.