OK, do you have any suggestions for alternative methods?
Yup
Make a checkbox, or a selection of them, out of CSS style elements and
use the onclick function to pop a transparent gif tick over them..
i,e. do the whole thing in css styles and javascript.
here's a useful style element I use to duplicate a <INPUT type="text"...>
..dummytext
{
font-family: Verdana, Arial, Helvetica, sans-serif;
padding: 2px;
border-style: inset;
border-width: 2px;
border-top-color: #e0e0e0;
border-left-color: #e0e0e0;
border-bottom-color: #e0e0e0;
border-right-color: #e0e0e0;
cursor: pointer;
color:#101080;
font-size: 12px;
font-weight: normal;
background-color: #c0c0c0;
}
use that to style an absolutely positioned little <div> box, and
superimpose the image of a tick over it at say z-index: 1, and move that
from display: none to display: block onclick..
Your onclick function should
...set/unset a hidden variable with the name of the parameter you want to
set.
toggle the display on the tick gif. So give the tick gif container a
unique ID.
You will need to have onlick applied to the tick gif as well, as that
will sit on top of the box when its ticked.
There are differences between the way IE7 and the other broswers
interpret borders and padding: The CSS above is my nearest to identical
across browsera i could get.
The HTML to use that class is exampled here
<div id="box_selected_product_id"
class="dummytext"
style="position: absolute; left:200px; top:10px; height: 16px; width:
250px; cursor: pointer;"
onclick="expand('selected_product_id','0','0')">Click here</div>
<input type="hidden" name= "selected_product_id" value="">
My expand function is actually doing something else..it generates a
flyout multilevel menu system that allows a <select> statement to be
duplicated, but at much greater ease of use.