PCHomepage
Programmer
I have a pair of checkboxes set up to deselect one of them if the other is selected so that only one can be submitted. It is also an option to not select either but when that is done, the value received is still 0 when it should be nothing or NULL. I didn't think I needed to to do anything special but after seeing the problem I added some code to try to force it but it made no difference.
I have this currently:
I also tried:
The checkboxes are:
Note that GetParam() is a custom function that trims any $_GET or $_POST value and does other simple pre-processing but it is not responsible for the problem as it makes no difference if I use $_POST instead of the function.
I have this currently:
PHP:
$OffSite = (GetParam("OffSite")) ? GetParam("OffSite") : NULL;
I also tried:
PHP:
$OffSite = (GetParam("OffSite")) ? GetParam("OffSite") : "";
The checkboxes are:
Code:
<input type="checkbox" name="OffSite" id="opt1" value="1" onchange="setChecked(this);">yes
<input type="checkbox" name="OffSite" id="opt0" value="0" onchange="setChecked(this);">no
Note that GetParam() is a custom function that trims any $_GET or $_POST value and does other simple pre-processing but it is not responsible for the problem as it makes no difference if I use $_POST instead of the function.