Hi All,
in my markup I Have:
Code:
<tr>
<td>@Html.LabelFor(model => model.CustomerLoanOfVehicleExtension, null, null, null)</td>
<td>@Html.CheckBoxFor(model => model.CustomerLoanOfVehicleExtension)</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>@Html.RadioButtonFor(model => model.CustomerLoanOfVehicleValue, "CCL", new { @class = "optVehicleExt" })@Html.LabelFor(model => model.ContingentCoverLoadValue, null, null, null)</td>
<td> </td>
<td>@Html.EditorFor(model => model.ContingentCoverLoadValue)</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>@Html.RadioButtonFor(model => model.CustomerLoanOfVehicleValue, "FCL", new { @class = "optVehicleExt" })@Html.LabelFor(model => model.FullCoverLoadValue, null, null, null)</td>
<td> </td>
<td>@Html.EditorFor(model => model.FullCoverLoadValue)</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
and then in JQuery I have:
Code:
function customerLoanOfVehicle() {
if ($("#CustomerLoanOfVehicleExtension").is(":checked")) {
$(".optVehicleExt").removeAttr("disabled");
} else {
$("#CustomerLoanOfVehicleValue").attr("disabled", "disabled");
$(".optVehicleExt").attr("disabled", "disabled");
}
}
This sets my optionbuttons enabled/disabled fine based on the checkbox.
My problem is that I cannot seem to get which of the option buttons have been set.
If I do something like:
Code:
$("#CustomerLoanOfVehicleValue").click(function () {
var value = $(this).val();
alert(value);
});
Only my first value ever gets hit. I.e. I click the option whos value is CCL and the alert says CCL, but when I click the option with FCL I get nothing?????