Partial Bolding in text box or rich text box OR Carriage return/Line feed in rich text box - InfoPath Dev
in

InfoPath Dev

Partial Bolding in text box or rich text box OR Carriage return/Line feed in rich text box

Last post 04-25-2011 06:41 AM by Bebhead. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-22-2011 07:08 AM

    Partial Bolding in text box or rich text box OR Carriage return/Line feed in rich text box

    Basically the situation is I have a comments history rich text box.  Right now there's an empty comment box that people can leave comments in and whenever the form is submitted their comment is added to the comment history with their name and a timestamp in front of it.  The problem is the comment history box ends up looking extremely cluttered, even with the time stamp it's hard to distinguish between different comments and I'd really like to make it stand out by either doing a new line for each comment or by bolding the name and timestamp before each comment.

     I've looked around for solutions to both of these, I would like to avoid code if at all possible, but I do know how to program if necessary.  As far as the carriage return goes, I tried a method which supposedly works for a lot of people where you create an receiving xml file data connection with an xml file like this:

     <?xml version="1.0" encoding="UTF-8"?>
    <characters
        cr="&#xD;"
        lf="&#xA;"
        crlf="&#xD;&#xA;"
    />

    and then use the crlf to get your new line, however this does absolutely nothing for whatever reason, I put this in a concat function and it doesn't complain, but it treats it as if there was nothing there.  What's weird is I used this method in an InfoPath 2007 form in the past and it worked out, so I'm assuming it's some kind of InfoPath 2010 thing (and at this point I don't think messing with trying to make the form an InfoPath 2007 form would be a good idea).

     As far as bolding goes, it doesn't seem to let me do a formatting rule on a rich text box that forces the text to be bold, nor does it let you set the default to be bold or anything like that.  I tried having a normal text box and making it bold and then using that for the timestamp function, and then adding that to the comment which gets added to the history, but when I attempt to transfer it over to the rich text box it loses the bold anyways.

     If anyone could offer some insight into this I'd really appreciate it!

     Thanks,

    Bebhead

  • 04-22-2011 04:05 PM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Partial Bolding in text box or rich text box OR Carriage return/Line feed in rich text box

    How are you appending their comment to the rest of the comments from other forms? Merge forms? Code?

    Anyway - one thought I have is to have the comment field (for the user) as a repeating field or in a repeating table.
    Only show the user one entry one row/section though (disable the insert buttons, or use conditional formatting).

    Then when you do you 'merge comments' method, just add their comment field/node to the collection of comments repeating field/group.
    You can then use whatever formatting you like to make each comment stand out from the others, e.g. a repeating section with a horizontal line at the bottom.

    As for the bolding - using the above methodology you would then be able to have a normal text field dedicated to the date/timestamp and display that in your repeating section/table with bold formatting just on it.


     

     

  • 04-25-2011 06:41 AM In reply to

    Re: Partial Bolding in text box or rich text box OR Carriage return/Line feed in rich text box

    Basically I have a comment box (rich text field) and when the form is loaded I copy the contents of that box into a temporary hidden box; then when a user submits the form with their new comments it appends the timestamp and then appends the contents to the temporary rich text field, and then finally it copies the contents from the temporary to the original comment box.

    I haven't really used repeating sections/fields much though, I'll have to look into that, however I have something like 12 different comment boxes that I need to do this for.  I'd much prefer having some kind of rule that I could just apply to all of them, or copy over than having to set up some kind of mechanism for each one...

     

    Thanks for your reply,

    -Bebhead

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