Hi all,
Searched the board over and over and wasn't able to find a solution to my problem. I think its one that alot of people might enjoy a solution to besides me 🙂
Basic?
I have a series of checkbox arrays like:
<input type="checkbox" name="delete[]" value="$row[id]">
These are for different records in my DB.
Now... I want to check (javascript) if one of them checkboxes HAS been selected and if so display a confirm message.
This is what I have:
function checkform(f) {
var el, e = 0, firstBox, msg = 'You are about to delete something';
while (el = f.elements[e++])
if (el.type == 'checkbox' && el.checked) {
return confirm(msg);
return false;
}
return true;
}
Now... this DOES work but with one problem.. I have another checkbox within the form that does something different but the confirm() will display if EITHER checkboxes are selected and it SHOULD ONLY be on the delete[] checkbox.
I'd be greatly indepth to someone who can help me with this. I've been all over the net and have found numerous code examples of silimar like things but usually involved soo much code I couldn't decipher it 🙁
thanks all.
Aaron