Hi,

i've got the following:

people can either pick an item from a drop down list, or open a table and fill out some fields. Whatever they've done, it is written away to a cookie.

This works.

What I would like extra and which I can't get to work is that when the submit button is hit, a form field gets a value as to whether the table was opened or not at the time of submitting.

You see, I would actually like the form fields in the table to stay populated with the input they once have given (if at all) but if the table was not opened when submitted, then one form field should say so (so I know to just look at the drop down value).

The code to hide/show the table is this:
Code:
function flipper(theTable)
{
var x=document.getElementById("city");
if (document.getElementById(text).style.display == 'none')
   {
   document.getElementById(text).style.display = 'block';
   x.disabled=true;
   txt="coordinaten";
   document.forms[0].geheim.value=txt;
   }
   else
   {
   document.getElementById(text).style.display = 'none';
   x.disabled=false;
   txt="plaats";
   document.forms[0].geheim.value=txt;
   }
}
and it sets the 'geheim' form field, but only if the state (show/hide) has been changed.

Thing is, the geheim form field is default on "plaats", but it will somehow change to "coordinaten" when one hits submit if that has been selected once. But only if the table state (show hide) has not been change this time.

You can see it in action here:
http://www.allesoversterrenkunde.nl/test/poa.html