Basic Text Formatting

B

BillT

I need to be able to dynamically write some text to the form in a textbox (or
some kind of control, preferably one which can be unbounded, but I don't
think that's going to be possible) based on some of the fields edited by the
form's user. This text needs to be selectable as I'm expecting the user to
cut and paste it. At the moment I cannot figure out a way to print newlines
to the screen. I really need to be able to format this text but any /n or
<br> just shows up as text. I thought perhaps a rich text field would be the
ticket, but I can't seem to get that to work, either. Any ideas?

Bill
 
G

G. Tarazi

To achieve that, you must use a rich text box, and the rich text box must be
linked to a data element in the schema (otherwise there is no other way to
access its contents).



Then you can assign and retrieve data from/to that box, getting the data is
simple, SelectSingleNode("path").xml , but assigning the data requires 2 XML
DOMS and some code, well, you can use the text property, but you will loose
the formatting. "Thanks to the Microsoft team who forgot that rich text
boxes can be assigned programmatically :), I hope they remember this in the
next InfoPath and have a single function for that".



Just search google to get how to assign a rich text box with a value.



The contents of the box are XHTML (sort of), you can get more info from this
link about XHTML



http://www.w3.org/TR/xhtml1/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top