Re: Condition Checking on Form Submission

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/Condition-Checking-on-Form-Submission-tp2998123p3008695.html

Phani,

All the conditions must pass before you are allowed to submit the
form. The way I understand your requirements, the issue with
conditions you had is that if field2 is provided, you don't care about
the length condition for field1. And vice-versa. So I modified the
first two conditions as follows:

<xforms:bind nodeset="condition[1]" constraint="$length2 != 0 or
$length1 ge 5"/>
<xforms:bind nodeset="condition[2]" constraint="$length1 != 0 or
$length2 ge 3"/>

I also attached the updated source. Does this do what you need for this case?

Alex

On Sat, Oct 16, 2010 at 3:44 AM, Phani Sajja <[hidden email]> wrote:

> Hi,
>    In my I have two input fields. User should provide at least one of the
> fields. Another check is the fields lengths. If field1 is filled it should
> be of length 5 or more, if field2 is filled it should be of length 3 or
> more. I have defined these conditions. If all of these are matched then the
> submission should happen. Otherwise it should open a pop up dialog and
> display what is wrong. Please see the attached code and tell me how to do
> it.
>
> --
> Regards
> Phani. S
>
>
>
> --
> 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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
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

20101023-form-validate.xhtml (6K) Download Attachment
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet