lalabored Posted June 15, 2007 Share Posted June 15, 2007 I need a check all button that will work with this... <input type="checkbox" name="check[]" value="1"> All the check all scripts I've found only work with name="check" and it doesn't have the brackets. I need to check all of the fields with the brackets, how can I do this? Quote Link to comment Share on other sites More sharing options...
lighton Posted June 15, 2007 Share Posted June 15, 2007 this is the javascript you will need function selectAll() { var box = document.getElementsByName('id[]'); if(box) { var boxes = box.length; for(var i = 0; i < boxes; i++) { if(box.checked) { box.checked = false; } else {box.checked = true;} } } } Quote Link to comment Share on other sites More sharing options...
jimmyyami Posted June 15, 2007 Share Posted June 15, 2007 this is also what i wanted Quote Link to comment Share on other sites More sharing options...
lalabored Posted June 16, 2007 Author Share Posted June 16, 2007 this is the javascript you will need function selectAll() { var box = document.getElementsByName('id[]'); if(box) { var boxes = box.length; for(var i = 0; i < boxes; i++) { if(box.checked) { box.checked = false; } else {box.checked = true;} } } } It doesn't work =\ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.