I created with Razor 3 radiobuttons:
@Html.RadioButtonFor(model => model.SelectType, "Checking")
@Html.RadioButtonFor(model => model.SelectType, "Funds")
@Html.RadioButtonFor(model => model.SelectType, "MoneyMarket")
Razor created the following HTML:
<input id="SelectType" name="SelectType" type="radio" value="Checking" />
<input id="SelectType" name="SelectType" type="radio" value="Funds" />
<input id="SelectType" name="SelectType" type="radio" value="MoneyMarket" />
Now I want to use JQuery to hide some options depending on which RadioButton was checked. I cannot do it, because each radiobutton has the same Id. Any ideas how to solve this problem?
Thanks,
z
As tymeJV said just assign the id manually.
@Html.RadioButtonFor(model => model.SelectType, "Checking", new { id = "rbChecking" })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With