This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Mozilla XML > May 2005 > XForms: Question about tax form example





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: Question about tax form example
Erik Bruchez

2005-05-23, 7:58 am

All,

I notice that this example, linked from here:

http://www.mozilla.org/projects/xforms/
http://www.mozilla.org/projects/xforms/sample1.xhtml

uses <xforms:label> all over the place outside XForms controls. It is my
understanding that <xforms:label> must be used within a control element,
see:

http://www.w3.org/TR/xforms/slice8....mmonelems-label

"This required element labels the containing form control with a
descriptive label"

So instead of:

<xf:label>Your first name and initial</xf:label>
<br/>
<xf:input ref="/f1040ez/section01/fname"/>

Use:

<xf:input ref="/f1040ez/section01/fname">
<xf:label>Your first name and initial</xf:label>
</xf:input>

If what I am saying is right, using <xforms:label> outside form controls
shouldn't even work.

Also, in the same example, I notice that the same "id" attributes are
used on many elements. I believe "id" attributes in XHTML must be
unique. Instead, the example should use class attributes for the purpose
of styling.

Please let me know if I should file bugs, but I think it's best if the
Mozilla XForms project doesn't start with spreading incorrect XForms
examples.

-Erik
Aaron Reed

2005-05-25, 8:06 pm

Erik Bruchez wrote:
> All,
>
> I notice that this example, linked from here:
>
> http://www.mozilla.org/projects/xforms/
> http://www.mozilla.org/projects/xforms/sample1.xhtml
>
> uses <xforms:label> all over the place outside XForms controls. It is my
> understanding that <xforms:label> must be used within a control element,
> see:
>
> http://www.w3.org/TR/xforms/slice8....mmonelems-label
>
> "This required element labels the containing form control with a
> descriptive label"
>
> So instead of:
>
> <xf:label>Your first name and initial</xf:label>
> <br/>
> <xf:input ref="/f1040ez/section01/fname"/>
>
> Use:
>
> <xf:input ref="/f1040ez/section01/fname">
> <xf:label>Your first name and initial</xf:label>
> </xf:input>
>
> If what I am saying is right, using <xforms:label> outside form controls
> shouldn't even work.
>
> Also, in the same example, I notice that the same "id" attributes are
> used on many elements. I believe "id" attributes in XHTML must be
> unique. Instead, the example should use class attributes for the purpose
> of styling.
>
> Please let me know if I should file bugs, but I think it's best if the
> Mozilla XForms project doesn't start with spreading incorrect XForms
> examples.
>
> -Erik


Hey Erik,

We created this particular XForm to give an example of what a user's
experience is with XForms. It is not, however, a good example of proper
XForms authoring (as noted in the Disclaimer toward the top of the form
source). Due to a variety of limitations that currently exists in our
XForms implementation, we could not achieve the table-type of layout
that we desired in any other way. When our next preview release comes
out and we can achieve the desired layout in the 'proper' way, we'll
update these samples and include new samples.

As far as bugs, there is nothing that says that a label MUST be
contained in a form control, though that is often the case and is pretty
much what it was designed for. So the fact that a label will render
outside of a form control is not a bug.

thanks,
--Aaron
Sponsored Links


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