Lost within

Alaa Abdelhaq Blog

Archive for July, 2009

let say you have a group of radio buttons sharing the same name attribute for sure, and upon submit or some event you want to check if one of these radio buttons was checked or not.
you can do this simply by the following code.

$(document).ready(function(){
  $('#submit_button').click(function() {
    if (!$("input[@name='name']:checked").val()) {
       alert('Nothing is checked!');
        return false;
    }
    else {
      alert('One of the radio buttons is checked!');
    }
  });
});

hope this will help you :)

Barack Obama looking at womans butt!!

heheheee :D
Barack Obama looking at womans butt

  • 4 Comments
  • Filed under: Fun, People, Politics