XForms validation using bind

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

XForms validation using bind

Martin.Pienaar

Hi All

I'm trying to work out a way to validate fields in an xforms:repeat.
For example (simple example):
I might have something like this:
<Person>
   <FirstName/>
   <Surname/>
</Person>

Person can be repeated using an xforms:repeat.
My problem is that I need to validate that if a FirstName is entered for the
Person, then their Surname must also be entered.

I thought of doing this with a bind, but if this xml structure is used within
an xforms:repeat, then how can I say that Person[1] has filled in a
FirstName[1] and so Surname[1] is mandatory?

Thanks in advance,
Martin


--
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: XForms validation using bind

Ryan Puddephatt-3
Try <xforms:bind nodeset="/person/surname" required="../firstname!=''"/>


-----------------------------------------------
Ryan Puddephatt
Connectivity Developer
Fidessa LatentZero
1 Old Jewry
London EC2R 8DN
Office: +44 (0) 20 7105 1000
Direct: +44 (0) 20 7105 1821
Blackberry: +44 (0) 79 8539 2458
Fax: +44 (0) 20 7105 1818
Email: [hidden email]
Web: http://www.latentzero.com


----- Original Message -----
From: [hidden email] <[hidden email]>
To: [hidden email] <[hidden email]>
Sent: Sat Jan 10 02:12:40 2009
Subject: [ops-users] XForms validation using bind


Hi All

I'm trying to work out a way to validate fields in an xforms:repeat.
For example (simple example):
I might have something like this:
<Person>
   <FirstName/>
   <Surname/>
</Person>

Person can be repeated using an xforms:repeat.
My problem is that I need to validate that if a FirstName is entered for the
Person, then their Surname must also be entered.

I thought of doing this with a bind, but if this xml structure is used within
an xforms:repeat, then how can I say that Person[1] has filled in a
FirstName[1] and so Surname[1] is mandatory?

Thanks in advance,
Martin


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

_______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com


--
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: XForms validation using bind

Martin.Pienaar
That fixed it! Thank you so much!

-----Original Message-----
From: Ryan Puddephatt [mailto:[hidden email]]
Sent: Saturday, 10 January 2009 12:18 PM
To: [hidden email]
Subject: [ops-users] Re: XForms validation using bind

Try <xforms:bind nodeset="/person/surname" required="../firstname!=''"/>


-----------------------------------------------
Ryan Puddephatt
Connectivity Developer
Fidessa LatentZero
1 Old Jewry
London EC2R 8DN
Office: +44 (0) 20 7105 1000
Direct: +44 (0) 20 7105 1821
Blackberry: +44 (0) 79 8539 2458
Fax: +44 (0) 20 7105 1818
Email: [hidden email]
Web: http://www.latentzero.com


----- Original Message -----
From: [hidden email] <[hidden email]>
To: [hidden email] <[hidden email]>
Sent: Sat Jan 10 02:12:40 2009
Subject: [ops-users] XForms validation using bind


Hi All

I'm trying to work out a way to validate fields in an xforms:repeat.
For example (simple example):
I might have something like this:
<Person>
   <FirstName/>
   <Surname/>
</Person>

Person can be repeated using an xforms:repeat.
My problem is that I need to validate that if a FirstName is entered for the
Person, then their Surname must also be entered.

I thought of doing this with a bind, but if this xml structure is used within
an xforms:repeat, then how can I say that Person[1] has filled in a
FirstName[1] and so Surname[1] is mandatory?

Thanks in advance,
Martin


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

_______________________________________________________________________
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

_____________________________________________________________________
This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com


--
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