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 / November 2007

Tip: Looking for answers? Try searching our database.

Getting display text  in drop down list(browser enabled infopath f

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rjayram - 16 Oct 2007 22:52 GMT
Hi,
  I have an infopath form where I use a webservice to populate a dropdown
list. I would like to know if there is a way for me to get the display text
of the option chosen by the user. I can get hold of the value, but not the
text. I am using C# code. All I need is this: the user makes a selection from
the dropdown and submits the form. I need to know the display text of the
option selected. The infopath form is browser enabled.

Kindly suggest a solution.

With Best Regards,
Jayram.
S.Y.M. Wong-A-Ton - 17 Oct 2007 00:28 GMT
Use an XPath expression that contains a filter on the value that was selected
from the drop-down list box and use this to retrieve the corresponding text
by doing a lookup in the secondary data source that the drop-down is bound
to. So:
1. Retrieve the secondary data source that the drop-down is bound to in code.
2. Use SelectSingleNode and an XPath expression to find the one record that
contains the selected value; use an XPath filter for this.
3. Modify the XPath expression to include the node that corresponds to the
text of the selected value, and retrieve its value.

I know it's cryptic, so if you still do not understand how to do it, let me
know and I'll schedule publishing a walkthrough on my website this coming
weekend.
---
S.Y.M. Wong-A-Ton

> Hi,
>    I have an infopath form where I use a webservice to populate a dropdown
[quoted text clipped - 8 lines]
> With Best Regards,
> Jayram.
rjayram - 17 Oct 2007 03:15 GMT
Hi Wong,

          Thank you for this excellent and informative(atleast to me and
hopefully to others as well) reply. I was able to use your pointers and get
what I wanted. Thank you very much. But I will still request you to go ahead
and post a walk through on your site. I am sure I will get pointers to better
my code.

Thank you,
Jayram.

> Use an XPath expression that contains a filter on the value that was selected
> from the drop-down list box and use this to retrieve the corresponding text
[quoted text clipped - 24 lines]
> > With Best Regards,
> > Jayram.
S.Y.M. Wong-A-Ton - 17 Oct 2007 07:18 GMT
No worries. And well done! Since you did solve it yourself, I won't give the
walkthrough a high priority, so may eventually write and publish it, but
perhaps not this weekend.
---
S.Y.M. Wong-A-Ton

> Hi Wong,
>
[quoted text clipped - 35 lines]
> > > With Best Regards,
> > > Jayram.
mzam - 01 Nov 2007 20:55 GMT
Hi Guys,

I need to do the same thing except that I have to do it all in the form, no
code involved.

I actually need to find out the display value of a drop down and use it as
File Name when submitting the form to a document library. So far I get the
value but not the display value. How do I do this without writing any C# code?

Regards,
Mario

> No worries. And well done! Since you did solve it yourself, I won't give the
> walkthrough a high priority, so may eventually write and publish it, but
[quoted text clipped - 41 lines]
> > > > With Best Regards,
> > > > Jayram.
 
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.