On Feb 25, 10:43 am, "claus.k...@googlemail.com"
<claus.k...@googlemail.com> wrote:
> On 24 Feb., 15:59, "claus.k...@googlemail.com"
>
>
>
> <claus.k...@googlemail.com> wrote:
> > Hello everyone,
>
> > I am using a clueTip to show a couple of options (checkboxes) on a
> > form.
> > It took me quite awhile to realize that the cluetip checkboxes are a
> > copy of the original group of checkboxes, existing outside of the
> > form. Therefore, the checkboxes were not submitted in their state.
> > So, the problem is: What is the correct way to write back the values
> > of the cluetip checkboxes to the original ones upon closing the
> > cluetip?
>
> > I think I could write a function which on close iterates over the copy
> > and writes back the values, but isnt there an easier way?
>
> > I would be very grateful for a few pointers on this.
>
> Ok, I solved it the stupid way:
>
> A "Save and close" button at the bottom of the cluetip which calls a
> js function on click which copies the values over to the original
> input elements.
>
> Pondering about this for some more, I get the feeling that there is
> something amiss.
Ok, I used this function:
function copyValuesAndClose()
{
var copy = document.getElementById('cluetip-inner');
var copy_elements = copy.getElementsByTagName("input");
var original = document.getElementById('permissions');
var original_elements = original.getElementsByTagName("input");
for (k = 0; k < copy_elements.length; k++)
{
original_elements[k].checked = copy_elements[k].checked;
}
$('cluetip').toggle();
}
Works fine in FF2, FF3. IE6, however, does not throw an error, but
also does not write back the values to the original input elements.
Could someone please lend me a hand for this?