Checkbox with javascript problem

For a current project, the user interface is all via html, using Rabbitweb. Am setting up the network parameters page, and have found an issue with the javascript that hope someone may be able to assist with.

Have a checkbox to select whether to use DHCP or go static. This is the first problem found, where we need to know both when the checkbox is selected, but also when it is not selected. As found in the Rabbitweb manual, the workaround is to place the variable as hidden prior to the checkbox input field. This works well, and has been tested and proven.

As an added bit of flair, now have some javascript that when the checkbox is selected, the static IP addresses are greyed out, and not selectable. This normally works fine, but with the dummy hidden variable assignment, the javascript stops working.

Does anyone know of a way to have the best of both worlds, and have the checkbox value posted for both checked and unchecked, and to have the javascript operate correctly?

Here is the code that causes the issues;

Network Configuration

Have searched high and low on the web, and really pulling my hair out on this one, any assistance would be greatly appreciated!

The property of a checkbox is accessed in JavaScript as checkbox.checked,
while an input is accessed via the input1.value

The code is probably trying to change the checked property of a input, or vice versa. I would recommend downloading a JavaScript debugging tool such as Firebug, and observing what errors are occurring.