jQuery validate groups of radiobuttons

I'm currently having a headache trying to figure this one out. I have a set of radiobuttons where three radiobuttons belongs to a question. It's basically a survey where you are able to choose answer A, B or C per question. What I want to do is to make sure that the user has selected either A, B or C for every group of radiobuttons. This should prevent the form submitting when there's an unanswered question. So basically the layout is as follows: Question: What day is it today? [A] [B] [C] A) Monday B) Sunday C) Wedensday [ ] [ ] [ ] I have made sure that each of the radiobuttons has the same unique id (well, the name attribute in this case) as their parent td's ID attribute, to be able to "group" radiobuttons that way. Has anyone done this before and are willing to share how you did it? :-) Would be greatly appreciated! Thanks in advance, Bo
possible duplicate of Validation of radio button group using jQuery validation plugin

以上就是jQuery validate groups of radiobuttons的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准