Código Javascript
:
Ver original<div id="_container">
<input type="checkbox" value="1" /><label>Opción 1</label><br />
<input type="checkbox" value="2" /><label>Opción 2</label><br />
<input type="checkbox" value="3" /><label>Opción 3</label><br />
<input type="checkbox" value="4" /><label>Opción 4</label><br />
<input type="checkbox" value="5" /><label>Opción 5</label><br />
<input type="checkbox" value="6" /><label>Opción 6</label>
</div>
<input id="_test" type="submit" value="Test" />
<script language="javascript" type="text/javascript">
document.getElementById("_test").onclick = function(){
var r = "" ;
var s = "" ;
var inputs = document.getElementById("_container").getElementsByTagName("input") ;
for(var i = 0 ; i < inputs.length ; i++){
if(inputs[i].checked){
r += s + inputs[i].value;
s = "," ;
}
}
alert(r);
}
</script>