JQuery “greying” out textfield in form

I have the following function, but it does not blur out when the radio button is selected to no. Any ideas why?

Form Element:

    Email: Yes? <input type="radio" name="emailquest" value="true" checked>
    No? <input type="radio" name="emailquest" value="false">
    <input type="text" name="email">


            if ($(this).val() != true)


As Pointy said, # is used for ID's, not names

    if (this.value != "true") { // <----I would probably change this to look for this.checked
        $("input[name='email']").prop("disabled", true);
    } else {
        $("input[name='email']").prop("disabled", false);

Live demo: http://jsfiddle.net/E3zDB/

Shortened version using a ternary operator:

    var input = $("input[name='email']");
    this.value != "true" ? input.prop("disabled", true) : input.prop("disabled", false);

Need Your Help

MySQL Query add limit in SubQuery

mysql subquery

Here is my table test with values:

NotifyDataSetChanged from fragment container

android android-fragments android-listfragment

I have an app with an Activity that hosts a ListFragment, an EditText, and a Button. When the user presses the Button, I want to add the text in the EditText to the ListFragment. I know to do this, I

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.