Javascript Disable/Enable Checkbox

Here is a quick function for you to disable or enable checkboxes using Javascript. The functon takes on two parameters, 1st is the checkbox object while the 2nd parameter is a boolean which is used to set a checkbox if it should be enabled or disabled.

function disableCheckbox(checkbox, disable) {
  var max = checkbox.length;
  for (var i=0; i<max; i++) {
    checkbox[i].disabled = disable;
  }
 
}

To use the function,

do this disableCheckbox(document.form_name.checkbox_name, true);

This, provided that your html form tags look like this

<form>
  <input name="checkbox_name" type="checkbox" value="1" /> 1st checkbox
  <input name="checkbox_name" type="checkbox" value="2" /> 2nd checkbox
</form>

I tried not using form tags and relied on the id attribute for the checkboxes but it seemed that it does not work. So, that is one tip for you. Hope anyone finds this useful.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(3 votes, average: 4.33 out of 5)
 Loading ...

GIF or PNG

GIF has been around for a very long time and is even a live in this digital age. I can’t say that it will be purely overtaken by PNG because there are still lots of people who use GIF format images. From a non-tecchie viewpoint, PNG would surely attract you than a GIF does especially if it deals with transparency.

GIF stands for Graphics Interchange Format, was developed in the late 1980’s and it is still widely used until now. PNG means Portable Network Graphics was developed around 1995 and became a W3C recommendation in 1996. I myself am impressed with how PNG displays itself with transparency involved. I had never wanted to get involved with PNG, not until Mac OS Widgets and Windows Vista Gadgets came to be. I wanted to check them out for myself how they work and since they standardized PNG as its format for its images, that was when I finally got to explore it. Boy, did it open my eyes regarding transparency, it’s way much better than GIF. PNG also compresses better than GIF in almost every case. The only drawback for PNG would be that in some old browsers, even Internet Explorer version 6, is not supported. But in many ways, I think it is superior to GIF. What do you think?

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

tags: ,

4 Comments

Google VS Cuil?

Cuil (pronounced Cool) recently launched and is the newest entry into Google’s list of competitors. I immediately checked it out and tried its technology. Before doing the search, the page shows that it has indexed more than a billion pages. Impressive, but I think Google also has the same, could be more or less but pretty sure a lot. Once the search results came out, I think that I like Google’s layout more, aside from the fact that people have gotten used to it, the results are presented in a better way than Cuil does. That is what made Google also stand out over Yahoo and Microsoft, not counting still how fast Google displays results and more so those that are relevant to the searched keyword that the user was searching for.

Having another competitor into the search engine wars is a welcome site to everybody. Google would always find ways to keep itself number 1. And competitors would find new stuffs to overtake them. At this time, Google owns a large share over search engine statistics and Cuil won’t overtake them, not this early and not this soon. Only time can tell … Who knows, the fact that Cuil is pioneered by some of Google’s main engineers can possibly jolt Google, but Google is still king at this time. I’ll wait and see how Cuil plans to overtake them over the next few years. What about you?

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...

Mutt Email Client No such file or directory (errno = 2)

When using the Mutt email client in Unix systems, you may find this annoying message

/var/mail/[user] No such file or directory (errno = 2)

prompted whenever you open the application. It’s not something that’s messing your mail server or something. To disable this message, use the touch command.

touch /var/mail/[user]

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(No Ratings Yet)
 Loading ...