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 form-validate.xhtml (5K) Download Attachment |
Administrator
|
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 |
Alex,
There are three conditions to be satisfied. 1. At least one of them should be filled 2. If first field is filled then it should have a field length of 5 or greater 3. If the second field is filled it should have a field length of 3 or more The submission should happen only when the conditions are met. For example, if the first field is present and it is of length 4 then it should display a message rather than submitting. If both are present then their respective lengths must match. On Sat, Oct 23, 2010 at 11:48 PM, Alessandro Vernet <[hidden email]> wrote: Phani, -- 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 |
Administrator
|
Phani,
Yes, this is inline with my understanding, and I think that the updated example I attached to my previous response implements those constraints. Do you see a situation for which the updated rules don't validate the fields properly? Alex On Sun, Oct 24, 2010 at 6:55 AM, Phani Sajja <[hidden email]> wrote: > Alex, > There are three conditions to be satisfied. > 1. At least one of them should be filled > 2. If first field is filled then it should have a field length of 5 > or greater > 3. If the second field is filled it should have a field length of 3 > or more > > The submission should happen only when the conditions are met. > For example, if the first field is present and it is of length 4 then it > should display a message rather than submitting. If both are present then > their respective lengths must match. > > On Sat, Oct 23, 2010 at 11:48 PM, Alessandro Vernet <[hidden email]> > wrote: >> >> 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 >> > > > > -- > 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
This is fine. But I want to open a popup window (dialog box for example) to indicate the message. Here conditions are ok, but the form is getting submitted for any case. But to show the message what I have to do. On Tue, Oct 26, 2010 at 11:08 AM, Alessandro Vernet <[hidden email]> wrote: Phani, -- 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 |
Administrator
|
Phani,
If the conditions are OK, and the only thing missing is to show the summary of the errors in a dialog when you submit the form, just put that markup inside an <xxforms:dialog>, and show in a handler for xforms-submit-error that you put inside the <xforms:submission>. If you've never worked with the <xxforms:dialog> before, you'll find more information about it here: http://www.orbeon.com/orbeon/doc/reference-xforms-extensions#dialog-dialog Alex On Tue, Oct 26, 2010 at 12:07 AM, Phani Sajja <[hidden email]> wrote: > Alex, > This is fine. But I want to open a popup window (dialog box for > example) to indicate the message. Here conditions are ok, but the form is > getting submitted for any case. But to show the message what I have to do. > > On Tue, Oct 26, 2010 at 11:08 AM, Alessandro Vernet <[hidden email]> > wrote: >> >> Phani, >> >> Yes, this is inline with my understanding, and I think that the >> updated example I attached to my previous response implements those >> constraints. Do you see a situation for which the updated rules don't >> validate the fields properly? >> >> Alex >> >> On Sun, Oct 24, 2010 at 6:55 AM, Phani Sajja <[hidden email]> >> wrote: >> > Alex, >> > There are three conditions to be satisfied. >> > 1. At least one of them should be filled >> > 2. If first field is filled then it should have a field length of >> > 5 >> > or greater >> > 3. If the second field is filled it should have a field length of >> > 3 >> > or more >> > >> > The submission should happen only when the conditions are met. >> > For example, if the first field is present and it is of length 4 then >> > it >> > should display a message rather than submitting. If both are present >> > then >> > their respective lengths must match. >> > >> > On Sat, Oct 23, 2010 at 11:48 PM, Alessandro Vernet <[hidden email]> >> > wrote: >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > 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 >> > > > > -- > 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
Finally I got the desired result. Thank you. On Wed, Oct 27, 2010 at 5:21 AM, Alessandro Vernet <[hidden email]> wrote: Phani, -- 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 |
Free forum by Nabble | Edit this page |