This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Mozilla XML > May 2005 > xforms seems a bit complicated





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author xforms seems a bit complicated
Mats Nilsson

2005-05-10, 7:42 pm

hi there,

Built in form validation seems to be the end result of xforms and that is..
well about bloody time, but why make it so complicated? wouldnt it be easier
to just add an attribute on a form field like this:

<input type="text" .... validation="required:yes; type: email;" />

This is really simplified, but I hope you get what I'm after anyway.

Using CSS-like syntax it would be really easy and quick to define properties
that should be considered during validation

theese could be

type: email|integer|anyvalue|SE-zipcode| ...... (it would be great if you
could specify your own types in an included file)
regexp: (any regular expression to be validated against. could be combined
with type to make a quick "email ending with mozilla.org")
errmsg: (message displayed when validation fails)

the only problem with this solution is dependencies. like:

password2 has to be equal to password1... and if newsletter checkbox is
checked you have to fill in email... this can be solved with event handling

hmm. any thoughts? Is this stupid? will there be tools for xforms that makes
it as easy as this way of doing it?

I have done something like this and it works in most browsers (except the
selectbox does not allow the alt-attribute in mozilla), but it would be much
nicer if browsers had it built in so you wouldn't have to work with the
scripting so much ;-)

//Mats Nilsson





Anne van Kesteren

2005-05-10, 7:42 pm

Mats Nilsson wrote:
> Built in form validation seems to be the end result of xforms and that is..
> well about bloody time, but why make it so complicated? wouldnt it be easier
> to just add an attribute on a form field like this:
>
> <input type="text" .... validation="required:yes; type: email;" />
>
> This is really simplified, but I hope you get what I'm after anyway.


You are looking for Web Forms 2 which will eventually also be integrated
in Mozilla (and Opera, and Safari):
<http://whatwg.org/specs/web-forms/current-work/>


--
Anne van Kesteren
<http://annevankesteren.nl/>
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews