Search code examples
javascriptjquerycheckboxselectallqueryselectall

Can I use code inspector in Firefox to do a Check All input type = checkbox on a website that isn't mine?


I have a question that is a little outside my realm. I'm a newbie to jquery and javascript. I run a forum on ProBoards, and when the forum runs out of its allocation for attachments (pictures the users can post) I have to manually go through the attachment list and check every single checkbox one by one, then I am able to click a delete button to delete every attachment I've checked. Checking the thousands of boxes one by one takes forever. There is no implemented "check all", and there are thousands of checkboxes.

In the code, every single checkbox has the name ids[]:

<input type="checkbox" value="1494" name="ids[]"></input>

So I should be able to target them by the name "ids[]" I would think. The value is different for each one. The name is the same for all. But the question is... what code would I use and where would I put it in Firebug or Inspector? I'm sadly too much of a noob to be able to figure out what I would do.

I have Firebug for Firefox, and in that I have the add-on jQuerify, so I can force jQuery into the code if that helps create the simplest solution.

Basically I'm looking for a way to add some code to automatically check every single one of these boxes (or add a button that will allow me to do so if that is the only way), and I must be able to do it from Firebug or the Inspector in Firefox (or even in Chrome would be fine). I don't think I am able to modify the code (permanently) of this specific administrative page of my forum, so I need to be able to do it from the Inspector/Firebug. I'd like something I can just copy and paste into there to save myself 45 minutes to an hour of clicking thousands of checkboxes one by one.

Any solutions?


Solution

  • Use like this,

    $("input:checkbox").attr('checked','checked');