Proposal: Improve <input> validation

Madam, Sir.

I'm working on a register form and note that the new <input> constraints
(new types and pattern attribute) isn't enough.
An identical constraint will be usefull for checking if password or email
are correctly written.

<input type="email" name="email_main" />
<input type="email" name="email_confirm" identical="email_main" />

The identical attribute informs on the reference <input> by his name.
It's limited to the same <form>.
The identical constraint override the type validation with a basic test
(see below)
As a result, the type attribute may be ommited in this case, the type of
the reference input will be used instead.

if email_confirm.value == email_main.value
then
    email_confirm.isvalid = email_main.isvalid;
else
    email_confirm.isvalid = false;
end

Received on Tuesday, 19 March 2013 16:46:44 UTC