mcb359 Posted June 12, 2007 Share Posted June 12, 2007 Hi. I was wondering if it is possible to have two web pages, perhaps arranged in side by side frames, where one has a control that will check or uncheck all the checkboxes on the other page at once as though I had down down the checkbox page and checked/unchecked them all manually? The main reason for this is that I'm having to do a lot of this checking/unchecking on a website that I frequent and I was looking for a way to speed up the process.Thanks! Link to comment Share on other sites More sharing options...
jesh Posted June 12, 2007 Share Posted June 12, 2007 Here is some code you can use to check all of the checkboxes that are on a page: var inputs = document.getElementsByTagName("input");for(var i = 0; i < inputs.length; i++){ if(inputs[i].type == "checkbox") { inputs[i].checked = true; }} Then, if you are using Firefox, you can download the Firebug extension which allows you to open up a javascript console and execute any javascript you want on the page you are visiting. Paste that code into the console and hit Run, and all the checkboxes on the page you are visiting will be checked.I don't believe you are going to be able to do this using frames unless both sites are on the same domain. I may be wrong about that though. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 12, 2007 Share Posted June 12, 2007 As far as executing this code goes, I feel compelled to pimp Opera. With Opera, you can save this code into a Javascript file and have Opera load the file on every page and just execute it, or you can also put Javascript code onto a button and put the button in your toolbar, so that clicking on the button would execute the Javascript associated with it. In this case, it would be a button that checks every checkbox on the page. You can check here for a bunch of custom buttons and instructions for making your own:http://operawiki.info/CustomButtons Link to comment Share on other sites More sharing options...
mcb359 Posted June 12, 2007 Author Share Posted June 12, 2007 Thanks for the help! I have Firefox and Opera, but I'm not really sure how to go about getting the code to run in either. Culd you describe what to do please? Thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 12, 2007 Share Posted June 12, 2007 You can install the button for Opera here:http://manchine.net/w3/check.htmlCheck the page source to see how I did that. I used this page for reference, I checked the source of the page to see how they set those up:http://operawiki.info/CustomButtons#creating Link to comment Share on other sites More sharing options...
mcb359 Posted June 12, 2007 Author Share Posted June 12, 2007 That's brilliant! It works perfectly. Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.