It is currently Sat Dec 02, 2017 4:03 pm Advanced search
<input type="checkbox" id="tickme" name="tickme" value="true" /><label for="tickme">Free beer?</label>
mskinner wrote:In HTML4/XHTML1 you can already do this:
- Code: Select all
<input type="checkbox" id="tickme" name="tickme" value="true" /><label for="tickme">Free beer?</label>
The "for" attribute on the label is the thing to note. When a user clicks on the label, the checkbox state (checked / not checked) will switch.
JoonasLinde wrote:It would be fantastic, if future versions of HTML (maybe HTML5) would allow these things without Scripting, just declarative with HTML / CSS.
Marius wrote:Today's HTML/CSS already is very complex. But programming-/scripting-languages are even more complex and difficulter to learn and to use.
JoonasLinde wrote:5. And JavaScript is often used to mark the active text-box (from many text-boxes) with a colored line around it or something like that (e.g. in GoogleMail).
input[type="text]:focus {
/* do whatever you want */
}
JoonasLinde wrote:There are some things (esp. with Webforms) that are often used in today's web and done with Scripting. It would be better, if these things would be possible without Scripting, only declarative with HTML / CSS:
1. In search-boxes Javascript often is used for send every typed character to the server and the server returns search-suggestions "as-you-type". If this would be possible without Scripting only with HTML/CSS (maybe a special text-field or an option for all text-fields) this would be very cool.
2. I've seen this at the online-dictionary dict.leo.org: they made a JavaScript-function, that you can type the word to translate without the text-box marked and the characters get in there. So, you don't have to mark the right textbox before you type, but you can type, no matter to look, if the box is marked. I know of the autofocus-tag in HTML5, but this only sets the focus on start, but not even when you clicked elsewhere on the page, like dict.leo.org does and what is very cool.
3. The german library-catalog "KVK" (http://www.ubka.uni-karlsruhe.de/kvk.html) uses JavaScript in Forms, to toggle multiple check-boxes on/off by clicking only one check-box.
In detail: there are inferior check boxes you can toggle on/off separate. And superior check-boxes, that toggle on/off groups of those inferior check-boxes, with just one activation/deactivation of this superior check-box.
4. Often JavaScript is used to expand/collapse parts of a form (e.g. in Mail-Forms to expand/collaps the CC- and BCC-field).
5. And JavaScript is often used to mark the active text-box (from many text-boxes) with a colored line around it or something like that (e.g. in GoogleMail).
It would be fantastic, if future versions of HTML (maybe HTML5) would allow these things without Scripting, just declarative with HTML / CSS.
Greetings,
Joonas Linde
Return to Feedback on the Specs
Users browsing this forum: No registered users and 1 guest