<input type="checkbox" name="materialIds" id="materialIds" value="{$v.id}" />{$v.title}
obj = document.getElementsByName("materialIds");
check_val = [];
for(k in obj){
if(obj[k].checked)
check_val.push(obj[k].value);
}
alert(check_val);