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

Pushing object with observable properties in observable array still track object's propteries.

javascript knockout.js knockout-2.0

I have an object addItem with several observable properties. Once the properties are populated I push this into an observable array allItems that tracks all the object created during a session.

Celery slowing down django

django celery supervisord kombu

I have a django 1.3 site using SQLite. It works well.