Colour display in a LOV
Pete88Apr 12 2008 — edited May 1 2008Hello all
I trying to create a LOV for colours to enable the end user to select a colour and not just a colour code
Using information on Patrick Wolf web site ...http://www.inside-oracle-apex.com/2007/08/add-colors-or-images-to-your-select.html ... I am almost there
So far ...
1) created a table with colour codes ... colour_number (ff8080, ff80ff, etc)
2) Created a LOV select
select COLOUR_NUMBER display_value, COLOUR_NUMBER return_value
from COLOUR
order by 1
this gives a list of the colour codes
3) Created a Post Element Text (field name is P2_HEADER_COLOUR)
<script type="text/javascript">
$x("P2_HEADER_COLOUR").style.backgroundColor = '("P2_HEADER_COLOUR")';
</script>
This does not work as above ... I have a systax error in?
= '("P2_HEADER_COLOUR")'
(If I used = 'ff8080' it works ... but the LOV is all one colour!)
If it is only a systex error? ... please could someone help me with the "error of my ways"
If anyone knows better away of doing LOV showing a list of colours (as colours not numbers) in would be great to know?
Thanks for looking
Pete