Required attribute

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Required attribute

johnadamturnbull

Using FF 3.5.3 and Orbeon 3.7.1.2, I'm getting unexpected results with:

<xforms:bind nodeset="book">
                             <xforms:bind nodeset="title" required="true()"/>
                             <xforms:bind nodeset="author" required="true()"/>
</xforms:bind>

I am able to Save a book record with empty title and/or author fields.

I'm following the tutorial carefully but I note that the example source uses
the XPath "instance('books-instance')/book"). This also fails in my form. My
instance seems correct. Any ideas?

Thanks

--jat


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Required attribute

johnadamturnbull
Figured it out ... in fact I am not able to save an empty field when
required is true.

But, I'm not getting an alert message from

<xforms:input ref="title">
              <xforms:label>Title</xforms:label>
              <xforms:alert>The title is required</xforms:alert>
 </xforms:input>

Should I be? Or is there another missing piece I should be aware of?

Thanks

-- jat


[hidden email] wrote:

> Using FF 3.5.3 and Orbeon 3.7.1.2, I'm getting unexpected results with:
>
> <xforms:bind nodeset="book">
>     <xforms:bind nodeset="title" required="true()"/>
>     <xforms:bind nodeset="author" required="true()"/>
> </xforms:bind>
>
> I am able to Save a book record with empty title and/or author fields.
>
> I'm following the tutorial carefully but I note that the example source uses
> the XPath "instance('books-instance')/book"). This also fails in my form. My
> instance seems correct. Any ideas?
>
> Thanks
>
> --jat
>  


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Required attribute

Alessandro Vernet
Administrator
John,

On Wed, Oct 7, 2009 at 1:28 PM, John Turnbull
<[hidden email]> wrote:
> Figured it out ... in fact I am not able to save an empty field when
> required is true.

Correct. You should not be able to submit an instance if it contains
empty nodes marked as required.

> But, I'm not getting an alert message from
>
> <xforms:input ref="title">
>             <xforms:label>Title</xforms:label>
>             <xforms:alert>The title is required</xforms:alert>
> </xforms:input>
>
> Should I be? Or is there another missing piece I should be aware of?

You should be getting an alert in that case. I just test this in an
example, and it is working fine for me. If you still have this
problem, could you submit a simple example that shows this and runs in
the XForms sandbox?

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws