I am trying to create a script that posts the result of a radio button click using Ajax.

So far I have:

```
<label>
    <input type="radio" name="DisableAd" value="0" id="RadioGroup1_0" />
    Radio
</label><br/>
<label>
    <input type="radio" name="DisableAd" value="0" id="RadioGroup1_1" />
    Radio
</label>

```

and:

```
$(document).ready(function() {
  $('.DisableAd').click(function() {
    event.preventDefault();

    var parameters = {
      'disAd': $('input[name="DisableAd"]').val(),
    };
    if (parameters == 0) {
      parameters = 0;
    } else {
      parameters = 1;
    }

    console.log('Posting: ', parameters);

    $.ajax({
      url: 'disableAd.php',
      data: parameters,
      type: 'post',
      dataType: 'json',
      success: function(data) {
        //  ... do something with the data...
        console.log('Ad disabled', data);
      }
    });
  });
});

```

The above code does not work but I can't see where I am going wrong.

Many thanks for your time.