Damn I can be dense sometimes.
The page I was working on can be viewed at:
http://www.traintosuccess.com/online-courses/sales_qa_demo/configurator.php?productid=96
The problem was that I forgot I wrote a custom function to submit the form in a special way. I called the function "submitForm" and then every time I looked at my button that called the function, I just thought I was looking at the regular "submit" method. DOH! I figured my problem out several minutes later. I was looping through all the form elements and if they were not "disabled" or if the were "checked", I was adding them to the query string. Problem is, my radio buttons were never set to be disabled, so it added both values to the query string regardless of which one was "checked". The reason I created the custom submit function below is because I found it to be very useful to make an interface that allowed a user to toggle a series of pull-down menus on and off and then, only sending the enabled form fields to the next PHP page. That way, I never had to determine which categories a person actually wanted, I only queried categories that had a number of questions set for that category. In order for this not to choke on radio buttons, I needed a more complex conditional. All my custom functions can be seen below for anyone that is trying to do something similar....the code below is JAVASCRIPT, not PHP.
function submitForm(theForm) {
windowName = "testwindow";
windowURL = theForm.action + '?';
for (i = 0; i < theForm.length; i++){
if(i<theForm.length-1 && ((theForm.elements[i].disabled != true && theForm.elements[i].type != 'radio')|| theForm.elements[i].checked == true)){
windowURL = windowURL + theForm.elements[i].name + '=' + theForm.elements[i].value + '&';
}else if((theForm.elements[i].disabled != true && theForm.elements[i].type != 'radio') || theForm.elements[i].checked == true){
windowURL = windowURL + theForm.elements[i].name + '=' + theForm.elements[i].value;
}
}
testwindow = window.open(windowURL, windowName,'status=yes,scrollbars=yes,resizable=yes,width=800,height=600');
testwindow.focus();
}
function toggleFormElement(thecheckbox,formelement){
//var formelement="number_questions"+category_id;
if(eval("document.config_form."+thecheckbox+".checked==true")){
eval("document.config_form."+formelement+".disabled=false;");
}else{
eval("document.config_form."+formelement+".disabled=true;");
}
}
function setAllQuestionCounts(numberneeded){
//loop through all the form elements in the config form
for (i = 0; i < document.config_form.length; i++){
if(document.config_form.elements[i].type == "select-one" ){
if(document.config_form.elements[i].options.length >= numberneeded){
document.config_form.elements[i].selectedIndex = numberneeded-1;
}else{
document.config_form.elements[i].selectedIndex = document.config_form.elements[i].options.length-1;
}
}
}
}
function selectAllCategories(){
//loop through all the form elements in the config form
for (i = 0; i < document.config_form.length; i++){
if(document.config_form.elements[i].type == "checkbox" ){
document.config_form.elements[i].checked=true;
document.config_form.elements[i+1].disabled=false;
}
}
}
function deselectAllCategories(){
//loop through all the form elements in the config form
for (i = 0; i < document.config_form.length; i++){
if(document.config_form.elements[i].type == "checkbox" ){
document.config_form.elements[i].checked=false;
document.config_form.elements[i+1].disabled=true;
}
}
}
function invertAllDisabled(){
//loop through all the form elements in the config form and set enabled ones to disabled and vice versa
for (i = 0; i < document.config_form.length; i++){
if(document.config_form.elements[i].type == "checkbox" ){
if(document.config_form.elements[i].checked==true){
document.config_form.elements[i].checked=false;
document.config_form.elements[i+1].disabled=true;
}else{
document.config_form.elements[i].checked=true;
document.config_form.elements[i+1].disabled=false;
}
}
}
}
Hopefully these functions will save someone out there some time. They assume you are generating a series of numbered form elements based on a particular name, and that you want to be able to toggle them on and off.