tags:

views:

52

answers:

1

As a solution to the "has a SelectedValue which is invalid because it does not exist in the list of items." error caused by null values in the database being bound to a radio button, I want to add an extra radio button with a value of '' that will allow nulls to bind to the RadioButtonList.

I am going to have lots of these, so I want to select all radio buttons who have a value of '' and hide them.

Note, I am not wanting to determine which of the radio buttons is selected.

I tried:

 $(document).ready(function() {
    $("radio[value=''").hide();
});

But no luck.

+2  A: 

Try this:

$(':radio[value=""]').hide();

or this:

$(':radio[value=]').hide();
Darin Dimitrov
And to hide accompanying label text:$(':radio[value=""]').hide().next().hide();
tbone