[whatwg] [WF3] <input type=selector>

Dean Edwards dean at edwards.name
Sat Dec 10 05:20:44 PST 2005


This is something for Web Forms 3.0 (though it would be nice for WF2).

In the repetition models I've implemented in the past (always tables) 
I've provided a way to select a table row. This meant including either a 
radio button or checkbox in the first column. When checked, the entire 
row would be selected.

<input type="selector">
=======================

I suggest introducing a new input type to facilitate the selection of 
repetition blocks: <input type="selector">.

This would render as either a radio button or checkbox depending on an 
additional constraint on the repetition template.

When the selector control is checked it results in the repetition block 
being selected (the CSS3 ":selected" pseudo class would apply).

repeat-selection="single|multiple"
==================================

I suggest adding a new attribute to repetition blocks (although this is 
only appropriate to repetition templates).

"single" would be the default and would mean that only one block can be 
selected at a time. If another block is selected the currently selected 
block is deselected. <input type="selector"> controls are rendered as 
radio buttons.

"multiple" means that any number of blocks can be selected. <input 
type="selector"> controls are rendered as checkboxes.

Changes to <input type="delete">
================================

the current definition of this control means that a <input 
type="delete"> element must be contained by a repetition block for it to 
be active. I suggest allowing the same constraints that apply to <input 
type="add"> so that the delete control can apply to selected elements if 
placed outside of a repetition block. In reality this means that you 
only need one delete button to control your repeating form controls.

.selected DOM Property
======================

Not sure we need this but it would be nice to be able to test whether or 
not a repetition block is selected using a DOM property.

Other Possible <input> Types
============================

The introduction of <input type="selector"> opens the door to other 
input types. Possibly <input type="copy"> and <input type="paste">? They 
would be similar to the add/delete controls but would use the clipboard.
<input type="copy"> would delete selected blocks but store the 
associated data. <input type="paste"> would add new rows and populate 
them with data from the clipboard.

-dean





More information about the whatwg mailing list