[eluser]nigelb[/eluser]
Hi
I have a form field array that I want to submit to a database. Is there a way that I can use the CI validation rules on this.
Currently I am experimenting with javascript but not having much luck.
Code:
function checkuploads(form) {
var file;
var q;
for (i=0; i<form.elements['partnumber[]'].length; i++) {
q=i+1;
if (form.elements['partnumber[]'][i].value!= '') {
//file += form.elements['user_files[]'][i].value;
if (form.elements['location[]'][i].value='') {
alert("Enter Location in row"+q);
return false;
}
if (form.elements['qty[]'][i].value='') {
alert("Enter Qty in row"+q);
return false;
}
}
return true;
}
}