I would like to store the checkbox value in an array, however, i can not use the validate rules since the name is selectList[]
instead of selectList
. I tried id but it seems the rule only bind to the name.
html:
<input id='sendList' type='checkbox' name='selectList[]' value='$set[ListID]'>
js rule:
$("#selectList").validate( {
rules: {
selectList[]: {
required: true,
minlength: 1
}
}
})
});
Thank you