mardi 2 juin 2015

If radio button is selected show alert

I want an alert to show when i click a radio button.

My radio buttons:

<div class="genericFormField">
   New:@Html.RadioButtonFor(m => m.Form.InstallType, 1, Model.InstallationHeader.InstallType == 1 ? new { Checked = "checked" } : null )
   Pool:@Html.RadioButtonFor(m => m.Form.InstallType, 2, Model.InstallationHeader.InstallType == 2 ? new { Checked = "checked" } : null)
   Refurb:@Html.RadioButtonFor(m => m.Form.InstallType, 3, Model.InstallationHeader.InstallType == 3 ? new { Checked = "checked" } : null)              
</div>

So if the radio button new is selected i want an alert to say "NEW" otherwise nothing.

Normally it is easy because you have id but in this occasion there is no ID?

As this is RadioButtonFor.

Thanks

Aucun commentaire:

Enregistrer un commentaire