<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<script type="text/javascript">
function recompileValue(){
var strValue = "radiobtn=";
var strButtonValue = "";
if(document.getElementById("radiobtn1").checked){
strButtonValue = document.getElementById("radiobtn1").value;
}
if(document.getElementById("radiobtn2").checked){
strButtonValue = document.getElementById("radiobtn2").value;
}
if(document.getElementById("radiobtn3").checked){
strButtonValue = document.getElementById("radiobtn3").value;
}
strValue = strValue + strButtonValue;
var strBoxValue = "";
if(document.getElementById("cbox1").checked && document.getElementById("cbox2").checked){
strBoxValue = "both";
}
if(!document.getElementById("cbox1").checked && !document.getElementById("cbox2").checked){
strBoxValue = "none";
}
if(document.getElementById("cbox1").checked && !document.getElementById("cbox2").checked){
strBoxValue = document.getElementById("cbox1").value;
}
if(!document.getElementById("cbox1").checked && document.getElementById("cbox2").checked){
strBoxValue = document.getElementById("cbox2").value;
}
strValue = strValue + "&cbox=" + strBoxValue;
document.getElementById("computedvalue").value = strValue;
alert("The value of the 'computedvalue' field is now:\n\n" + document.getElementById("computedvalue").value);
}
</script>
</head>
<body>
<form action="someform.ext" name="myform" id="myform">
<fieldset>
<legend>Radio Buttons</legend>
<input type="radio" checked="checked" value="radio1" name="radiobtn" id="radiobtn1" onclick="recompileValue()"> radio1 <br>
<input type="radio" value="radio2" name="radiobtn" id="radiobtn2" onclick="recompileValue()"> radio2 <br>
<input type="radio" value="radio3" name="radiobtn" id="radiobtn3" onclick="recompileValue()"> radio3 <br>
</fieldset>
<fieldset>
<legend>Check Boxes</legend>
<input type="checkbox" value="cbox1" name="cbox" id="cbox1" onclick="recompileValue()"> cbox 1 <br>
<input type="checkbox" value="cbox2" name="cbox" id="cbox2" onclick="recompileValue()"> cbox 2 <br>
</fieldset>
<input type="hidden" name="computedvalue" id="computedvalue" value="radiobtn=radio1&cbox=none">
<input type="submit">
</form>
</body>
</html>