Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

jquery and .net radiobuttonlist

I have been working with the plugin from this site
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

What I can't figure out is how to apply the validation to a asp.net radio button list. Can someone help me.
Avatar of chapmanjw
chapmanjw
Flag of United States of America image

You would use the same method as any other input, you just need to be sure to reference it's client ID (which is different that the ID tag you give it in the ASPX page):

$("#'<%=DropDownListID.ClientID %>'")

Replace DropDownListID with the ID tag you assigned in your .NET code.
Avatar of NickMalloy

ASKER

If I add the ID of the radiobuttonlist it puts the error message text in the first list option. I want the error text to appear next or below the radiobuttonlist.
You can use the asp:RequiredFieldValidator instead for that field.  When a radio button list is rendered on the client side, it shows up as separate input controls with the same name.  So the method you are using ties itself to the first item, not all the items as a single unit.
ASKER CERTIFIED SOLUTION
Avatar of BurnieP
BurnieP
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial