Automatically Select First NonBlank Item in List Box - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Automatically Select First NonBlank Item in List Box

Last post 07-25-2011 05:45 AM by kmhaga03. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-19-2011 12:39 PM

    Automatically Select First NonBlank Item in List Box

    My form is using an xml data source from SharePoint (because of multiline fields). Once the user types in a text box, a listbox filters the xml data off of that textbox and displays the appropriate information. However, I want it to also automatically select that line of data.

     

    In reference to the image below, essentially what I want is the "<div> Soldier" line to be automatically highlighted.

     

     

  • 07-24-2011 02:01 PM In reply to

    Re: Automatically Select First NonBlank Item in List Box

    Hi kmhaga03 and welcome,

    It looks like your list box is displaying HTML text which will complicate things. To select a value in a list box, you just set the value of the list box to the value you want to select. In this case, you would add a set value rule to do this for the <div>Soldiers ... line. Not hard to do after the data is queried. However, the markup will make it difficult. It almost seems like you have a rich text control (not a list box) and what you really want to do is to highlight a section in it. That requires editing the rich text XHTML markup which is going to be tricky because you will have to parse it and add the highlight codes correctly around just hte section you want highlighted. That feature definitely is not supported in out-of-box InfoPath. You could write code to do it, but editing XHTML is just not a good idea since it can lead to broken data if you have bugs in your parsing logic.

    Sorry I don't have a more promising reply...

    Patrick Halstead
    Project Manager at Qdabra
  • 07-25-2011 05:45 AM In reply to

    Re: Automatically Select First NonBlank Item in List Box

    Hi Patrick,

    Thank you so much for your response. I actually got a change in requirements and have started doing it differently. But, I am curious, if I did want to set a value rule to select a certain line, how would I do that? I've set rules, but haven't yet figured out how to select a certain line.

    Thanks again!

    Kristina

     

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.