Selected values:
Code:
$(document).ready(function () {
$("#values").html("None");
$("form").submit(function (e) {
e.preventDefault();
var values = $("input[type=checkbox]:checked").val();
$("#values").html(values ? values : "None");
});
});
<form action="/" method="get">
<label for="test-1">Test 1</label>
<input type="checkbox" id="test-1" name="test" value="1" /><br/>
<label for="test-2">Test 2</label>
<input type="checkbox" id="test-2" name="test" value="2" /><br/>
<label for="test-3">Test 3</label>
<input type="checkbox" id="test-3" name="test" value="3" /><br/>
<label for="test-4">Test 4</label>
<input type="checkbox" id="test-4" name="test" value="4" /><br/>
<input type="submit" value="Show Values" />
</form>