Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

Repeating Group Data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
InfoHound - 22 Mar 2006 23:25 GMT
After a user enters several fields of data into a repeating group, I'd like
to traverse the collection of values and evaluate them using conditional
statements.  I don't have Visual Studio.Net, so I need to work in Jscript.
For example, if there's a textbox with a field name Field10 in a repeating
group, and a user enters Schnauzer, German Shepherd, and then Schnauzer a
second time, I want to run some code in the OnAfterChange event (I think) to
evaluate each of the entries the user made. If I find a duplicate, I want to
clear that instance and display a message to the user "You already chose that
value".  Can I do this using the J scripting language? How can I loop through
the values that a user entered in a field in a repeating group (all values
were entered into instances of a field that I only know as Field10). Thanks
for any advice provided.
Greg Collins [InfoPath MVP] - 23 Mar 2006 19:49 GMT
You will need to use XDocument.DOM.selectNodes("{MY XPATH HERE}/Field10");
Then you loop through the nodes that were found and if there is 2 more values matching what was just typed in you give your message.

You might want to use the OnBeforeChange event handler for this instead.

Signature

Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com

After a user enters several fields of data into a repeating group, I'd like
to traverse the collection of values and evaluate them using conditional
statements.  I don't have Visual Studio.Net, so I need to work in Jscript.
For example, if there's a textbox with a field name Field10 in a repeating
group, and a user enters Schnauzer, German Shepherd, and then Schnauzer a
second time, I want to run some code in the OnAfterChange event (I think) to
evaluate each of the entries the user made. If I find a duplicate, I want to
clear that instance and display a message to the user "You already chose that
value".  Can I do this using the J scripting language? How can I loop through
the values that a user entered in a field in a repeating group (all values
were entered into instances of a field that I only know as Field10). Thanks
for any advice provided.
_bizon - 23 Mar 2006 20:14 GMT
1. force user to enter data in field10 using the "Cannot be blank" validation
or similar;
2. also, you can disable the repeating table ability to add rows using
Conditional Formatting (if field10 is blank, "Don't allow users to insert or
delete this control")
3. in Data Validation for field10 use the following expression: . =
../preceding-sibling::*/my:field1, which will invalidate that field (a red
border will notify the user), thus the form won't submit successfully...
Signature

Liviu

> After a user enters several fields of data into a repeating group, I'd like
> to traverse the collection of values and evaluate them using conditional
[quoted text clipped - 8 lines]
> were entered into instances of a field that I only know as Field10). Thanks
> for any advice provided.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.