Re: Best solution to tedious form validation?
- From: "Rik Wasmus" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Mon, 29 Oct 2007 20:40:35 +0100
On Mon, 29 Oct 2007 19:43:32 +0100, otrWalter@xxxxxxxxx <otrWalter@xxxxxxxxx> wrote:
In your suggestion you have type="text" and type="alpha" in the same input
tag.
Yes, sorry...
<input type="text"
id="first_name"
name="first_name"
datatype="alpha" <- new attribute int|alpha|phone|
email|etc
required="true" <- new attribute true|false
value="">
Thx for the catch
Well, let's invent HTML attributes? Invalid HTML means all bets are off on how anything will be handled, and only by the grace of UA's kind enough to process broken tagsoup HTML will it do anything resembling to what you want. Don't rely on that, use a real attribute. A classname comes to mind.
<input type="text" name="firstname" class="foo alpha required" value="">
It can more reliable be read using javascript, is valid, and is the place where you're supposed to put this kind of stuff.
http://www.w3.org/TR/html401/struct/global.html#adef-class
"The class attribute has several roles in HTML:
- As a style *** selector (when an author wishes to assign style information to a set of elements).
- For general purpose processing by user agents."
--
Rik Wasmus
.
- Follow-Ups:
- Re: Best solution to tedious form validation?
- From: otrWalter@xxxxxxxxx
- Re: Best solution to tedious form validation?
- References:
- Best solution to tedious form validation?
- From: Gustaf
- Re: Best solution to tedious form validation?
- From: otrWalter@xxxxxxxxx
- Re: Best solution to tedious form validation?
- From: Shelly
- Re: Best solution to tedious form validation?
- From: otrWalter@xxxxxxxxx
- Best solution to tedious form validation?
- Prev by Date: Re: Best way to get the contents of a local file in a server variable
- Next by Date: Re: Securing an Email script
- Previous by thread: Re: Best solution to tedious form validation?
- Next by thread: Re: Best solution to tedious form validation?
- Index(es):