Monthly Archives: September 2008

jQuery Check All Checkboxes by Section

Recently I needed to allow users to check all checkboxes in a given section or the entire page. This is really easy to do with jQuery so let’s get to the sample:


Check All on this page

Check All in this group
Group 1 Check 1
Group 1 Check 2
Group 1 Check 3
Group 1 Check 4
Check All in this group
Group 2 Check 1
Group 2 Check 2
Group 2 Check 3
Group 2 Check 4

Here are the basics of the code:

jQuery Check All Checkboxes

The implementation can be done inline (as I did) or by creating an event handler via $(Document).ready();

The key points with the code is how the selectors grab the correct checkboxes to check/uncheck. The top checkbox grabs all of the checkboxes on the page and the inner checkbox grabs all of the checkboxes that are contained within the specified table. Once the checkboxes have been found their status is set to the status of the checkbox being used (all or section only).

Manners for Political Discussions

I spent the last 5 days with two guys that describe themselves as “bleeding democrats.” We worked together during the day then went for drinks at the hotel bar at night. We discussed many topics ranging from work problems, funny stories from the past, and of course, politics.

Given that these two guys are registered Democrats and very pro Obama they were speaking very highly of him and poking fun at McCain. I am an independent and don’t know who I am going to vote for but I was still able to have very healthy conversations with them for the entire week. I was pleasantly surprised at how well they handled me not being on their “team” and respecting what I had to say. Here are the tips I got from the conversations on how to act on both sides:

  • Do feel free to express your thoughts. It is a discussion.
  • Do listen to what people have to say. Again, it is a discussion.
  • Ask questions when someone makes a point that you don’t agree with or understand but make sure you ask it in a non-threatening way.
  • Stay calm.
  • If you are speaking with someone that knows what they are talking about, pick their brain. In this situation they are most likely more than happy to talk about it.

In the past I have had political conversations with people that turn into arguments instead. Here are my thoughts on the wrong way to do it.

  • Belittle someone for having an oppinion that differs from yours.
  • Laugh at a point they make.
  • Yell.
  • Cut them off mid-sentence.
  • Don’t listen.
  • Speak about things you know nothing or very little about and act like your word is the law.

These are all things that I thought people learned in kindergarten but apparently I was wrong. My mom was right, I am smarter than all the other kids.

Why I Haven’t Chosen Who To Vote For

I am a software developer by trade and have a scientific mind by nature. I am very good at quick and to the point. I don’t like wasting time. I understand this is one of my downfalls and I am trying to use this blog to improve my delivery of thoughts and ideas. Back to it though (nature wins again)

I am 100% actively not paying attention to what candidates are saying right now because they are just dancing around the real questions. I will start paying attention the last month before when they start putting together charts of where each candidate stands on major issues. I don’t like hearing a 5 minute ramble that doesn’t completely answer the question when it could be one or two sentences.

Most people like me don’t want to hear a candidate ramble about things related to an issue in hopes they can dodge actually answering the question. Ask a candidate what their stance is on abortion and they will start talking about educating people about birth control and instilling family values and whatever else they can think of. Get to it; are you pro-life or pro-choice? When it comes to taxing don’t sit there and tell me how you are going to help America get back on it’s feet and make life better for everyone. Tell me what taxes you are going to implement/cut, who it’s going to affect and by how much.

Give me the meat. Leave the parsely in the kitchen.

Dear Internet Explorer…

I’ve cheated on you. Many times. And I loved it.

For many years I have been one of your strongest supporters and proponents even when I knew little about my other options. I love most things Microsoft but you make it nearly impossible for me to love you anymore.

I zig, you zag.
I bob, you weave.

While I do believe in monogamy I think you should allow me to bring in others that will help me which in turn helps you.

Help me help you.

The things that I need do not seem to be that far fetched as your competition has them or at least allows others to fill the gap.  When I want to see all of the included JavaScript and CSS files I can you JSView. When I want to do ANYTHING with JavaScript, CSS, or the DOM I can use Firebug. When I don’t want my browser to crash or hog my system I can run any other browser.

I find that the only time I need you is for corporate purposes and testing for ill-informed users. I am sad to say this but I think we need to take a break and for once it’s you; not me.

Sincerely,
Luke