I have a text field that I want to display a caption with some built in scripting. For the Caption of the field I want to display part of the text that displays as static text in a regular format, while populating the second part of the caption with the value of a variable. For this second part of the caption I want to give the text an italic look. I can see how this is done when everything is static in the caption (going through the field/caption/value/exData/body tags in the XML for my form. Is there a way to set this up dynamically though through scripting.
I know for a work around I could just have two fields. One without a caption (that would represent my current text field, just remove the caption), and a second that would have my static caption, and have the field be the value that I display in italics. I was just wondering if there was a way to dynamically edit the caption of a field.
My testing is complete.....you have to create a variable that will hold the rich text formatting (in html format) that you will set in the caption. Then you need to load that variable into the appropriate property. It will look like this:
- You need to escape (\) the double-quotes () in the script in order for it to work
- I dont know how much of the namespace stuff you need, I just copy and pasted it from the XML source.....so set up a caption the way you want and copy and paste the exData segment so you can see how the attributes are set.
Thanks for the response. I figured there had to be a way to interject some html into the caption to do this, but I just couldn't figure out how exactly to accomplish that. While I ended up just breaking up my form and added two fields where I had just had the one before. I will go back and see if I can't get this to work. Thanks again, and I hope others find this useful as well.