xforms seems a bit complicated

"Mats Nilsson" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Swedish web developing company
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.