how to validate
duplicate entries in Forms?
if user enters name
which is already exists then a alert should be shown to the
user
Thanks,
Srikanth
-- 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 |
Hi,
Your question is not clearly mentioned. I assume in 2 ways 1) if name is entered which is already available in database we want to display a message . In that case once submitted you can select the username from database with entered name and if present you can return error message. 2) if only in one node say <name>srikanth</name> available and in the input box if the user types again name 'srikanth' then provide the name inputbox from another node of like <newname> and if the <newname> value is equal to <name> already exists you can display a message ... you can use bind set when already name exist to error or set value. If the <newname> entered is not matching the <name> you can set <newname> value to <name>
|
I want to validate name before submit i.e. is Second one which u have
mentioned works only if the is a single node I want to do for multiple nodes like below ---------------------------------------------------------------------------- ----------------------------------------- <programs> <program> <id>1</id> <programname>First</programname> <programdescription>Sridevi Dance Program</programdescription> <datasourcetype>yp</datasourcetype> </program> <program> <programname>Seconds</programname> <programdescription>Online School Demo</programdescription> <id>2</id> <datasourcetype>ns</datasourcetype> </program> </programs> ---------------------------------------------------------------------------- ---------------------------- I want to validate the program name The code I have used for ur example below which works for single node ---------------------------------------------------------------------------- --------------- <xf:model> <xf:instance id="term"> <data xmlns=""> <term-name>Product</term-name> <newname/> </data> </xf:instance> <xf:bind nodeset="newname" constraint="string(.)!=instance('term')/term-name"/> </xf:model> <xf:input ref="/data/newname" incremental="true"> ---------------------------------------------------------------------------- -------- -----Original Message----- From: subrahmanyam [mailto:[hidden email]] Sent: Thursday, November 27, 2008 9:14 PM To: [hidden email] Subject: [ops-users] Re: Validate duplicate entries in XForms Hi, Your question is not clearly mentioned. I assume in 2 ways 1) if name is entered which is already available in database we want to display a message . In that case once submitted you can select the username from database with entered name and if present you can return error message. 2) if only in one node say <name>srikanth</name> available and in the input box if the user types again name 'srikanth' then provide the name inputbox from another node of like <newname> and if the <newname> value is equal to <name> already exists you can display a message ... you can use bind set when already name exist to error or set value. If the <newname> entered is not matching the <name> you can set <newname> value to <name> srikanth.prodigy wrote: > > how to validate duplicate entries in Forms? > > if user enters name which is already exists then a alert should be > shown to the user > > Thanks, > Srikanth > > > -- > 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 > > View this message in context: http://www.nabble.com/Validate-duplicate-entries-in-XForms-tp20714624p207210 48.html Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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 |
Administrator
|
Something like this maybe:
<xforms:bind nodeset="program/programname" contraint="not(. = ../ preceding-sibling::program/programname)"/> -Erik On Nov 28, 2008, at 3:28 AM, Srikanth A wrote: > I want to validate name before submit i.e. is Second one which u have > mentioned works only if the is a single node I want to do for > multiple nodes > like below > ---------------------------------------------------------------------------- > ----------------------------------------- > <programs> > <program> > <id>1</id> > <programname>First</programname> > <programdescription>Sridevi Dance Program</programdescription> > <datasourcetype>yp</datasourcetype> > </program> > <program> > <programname>Seconds</programname> > <programdescription>Online School Demo</programdescription> > <id>2</id> > <datasourcetype>ns</datasourcetype> > </program> > </programs> > ---------------------------------------------------------------------------- > ---------------------------- > I want to validate the program name > > The code I have used for ur example below which works for single node > ---------------------------------------------------------------------------- > --------------- > <xf:model> > <xf:instance id="term"> > <data xmlns=""> > <term-name>Product</term-name> > <newname/> > </data> > </xf:instance> > > <xf:bind nodeset="newname" > constraint="string(.)!=instance('term')/term-name"/> > > </xf:model> > <xf:input ref="/data/newname" incremental="true"> > ---------------------------------------------------------------------------- > -------- > > -----Original Message----- > From: subrahmanyam [mailto:[hidden email]] > Sent: Thursday, November 27, 2008 9:14 PM > To: [hidden email] > Subject: [ops-users] Re: Validate duplicate entries in XForms > > > Hi, > Your question is not clearly mentioned. I assume in 2 ways > 1) if name is entered which is already available in database we want > to > display a message . In that case once submitted you can select the > username > from database with entered name and if present you can return error > message. > > 2) if only in one node say <name>srikanth</name> available and in > the input > box if the user types again name 'srikanth' then > > provide the name inputbox from another node of like <newname> and if > the > <newname> value is equal to <name> already exists you can display a > message > ... you can use bind set when already name exist to error or set > value. > > If the <newname> entered is not matching the <name> you can set > <newname> > value to <name> > > > > > > > srikanth.prodigy wrote: >> >> how to validate duplicate entries in Forms? >> >> if user enters name which is already exists then a alert should be >> shown to the user >> >> Thanks, >> Srikanth >> >> >> -- >> 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 >> >> > > -- > View this message in context: > http://www.nabble.com/Validate-duplicate-entries-in-XForms-tp20714624p207210 > 48.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 |
Free forum by Nabble | Edit this page |