I have a number of checkboxes formatted like so….
<input type="checkbox" name="mybox" value="box1">Box 1</input>
<input type="checkbox" name="mybox" value="box2">Box 2</input>
<input type="checkbox" name="mybox" value="box3">Box 3</input>
<input type="checkbox" name="mybox" value="box4">Box 4</input>
<input type="checkbox" name="mybox" value="box5">Box 5</input>
I am attempting to read in which boxes are ticked using javascript and save them as an array, I am using the following code….
function handleNotifyButtonClick() {
var type = $.trim($("input[@name='mybox']:checked").each(function()
{
add $(this).val() to your array;
}));
But for some reason its not working, can someone help?
This is English, not JavaScript.
Try this: