Gracias por sus respuestas;
He finalmente logrado hacer la función que necesitaba (gracias a un poco de este foro, otro poco de otros foros).
Aquí dejo el código por si en un futuro alguien llegara a requerir algo similar.
Código Javascript
:
Ver original<!-- En este ejemplo el formulario se llama "Tallas" -->
<script type="text/javascript" language="javascript">
function Checar(){
var elLength = document.Tallas.elements.length;
var Seleccionados = '';
var display = '';
var hids = '';
var b = 0;
for (i=0; i<elLength; i++)
{
var type = Tallas.elements[i].type;
var nombre = Tallas.elements[i].name;
var valor = Tallas.elements[i].value;
var totales = document.Tallas.elements.length;
if (type=="checkbox" && Tallas.elements[i].checked){
if( (b != 0) && (b != totales) ){ var linea = "|"; }else{ var linea = ""; }
if(linea == "|"){var agregar = "|" + valor + "&" + nombre; var mostrar = ", " + nombre; var esconder = "|" + valor;}
else if(linea == ""){var agregar = "" + valor + "&" + nombre; var mostrar = "" + nombre; var esconder = "" + valor;}
var Seleccionados = Seleccionados + agregar;
var display = display + mostrar;
var hids = hids + esconder;
b++;
}
else { }
}
if(b == 0){ alert('No se ha seleccionado NADA'); }
else{
alert(Seleccionados);
alert(display);
alert(hids);
}
}
</script>