1

This is a question that is particular to not using javascript because it's quite capable to accomplish this with it.

I'm building a form and there is an option for most questions that is a null scenario. For example:

What colors do you like?  
  [] Red  
  [] Blue  
  [] Green  
  [] Yellow  
  () None of the above 

In this situation, 'None of the Above' would be the null scenario. In html, is there a way for the checkboxes to clear when the radio is selected, and deselect the radio once any of the checkboxes are selected?

Providing a fiddle here for the basis of this question --> http://jsfiddle.net/Ze9RU/1/

dmaloney.calu
  • 776
  • 1
  • 7
  • 12
  • possible duplicate : http://stackoverflow.com/questions/396439/radio-checkbox-alignment-in-html-css?rq=1 – sertsedat Jun 26 '14 at 20:38
  • @jackjop not at all, the other question is about formatting. – Christopher Wirt Jun 26 '14 at 20:43
  • I'm quite convinced there is not, without Javascript. And what would be against JS? There hardly is one site anymore that does without it, nowadays. – Frank Conijn - Support Ukraine Jun 26 '14 at 20:47
  • @FrankConijn There's nothing here against JS. It was a question of curiosity for the most part as I was not able to find a similar topic elsewhere. As noted in the question, this is a relatively simple task to complete using JS or any of a handful of useful UI JS libraries. – dmaloney.calu Jun 26 '14 at 20:53

1 Answers1

0

In short, no. HTML is meant to remove logic as much as possible from the elements.

If you want to think of a page as being a MVC, then HTML is the model, CSS is the view and JavaScript would be the controller. The only way to get logic and control of this manner is through JavaScript, which as you said is quite simple.

EDIT: Here's a forked fiddle from before I read your question again :) http://jsfiddle.net/2j44r but I have to have code to post it so

It might save you some time if you go that route, but probably not.
Christopher Wirt
  • 1,108
  • 1
  • 10
  • 21