Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

First Time Open Script Question

Avatar

Level 3

I received a PDF form that I didn't create and the way that it is setup is that each text box has a script under it I believe its the FirstTime value script so when the form is opened the text box displays the wording.  My question is...is there a way or script where I can have one word underline??  When I try it with just using the button it underlines the whole thing.  Any help on this a greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10

You are loading richtext into the field so it is not as easy as setting the rawvalue like you have above. You will have to create an xHTML equivalent of what you want to load and then load it into the field when you are ready. The easiest way I have found to do this is to create what I want in a field then to get what the xHTML that represents that do a console.println(fieldname.value.exData.saveXML(); This will copy the xHTML to the javascript console. Then you can see what it looks like and adjust as you see fit .....when you are ready to load it again you would use fieldname.value.exData.loadXML(string that holds the xHTML, 1, 1); The two other paraneters that you pass determine whether to concate with what is there or overwrite it ...this is documented in the loadXML command.

Hope that helps

Paul

View solution in original post

0 Replies

Avatar

Level 10

Not sure that I follow you ....can you show us with images what you are after?

Paul

Avatar

Level 3

the script looks something like this...

if(topmostSubform.Page1.Section1.FirstTime.rawValue == "yes") {

     this rawValue = "1. Text Goes Here... \n" +

"Text Goes Here...Text Goes Here...Text Goes Here... \n" +

"Text Goes Here...Text Goes Here...Text Goes Here...";

So when the user opens the form...that text is displayed in the text of the form.  I was wondering how I could maybe get one or two of the words to be bold.

Avatar

Correct answer by
Level 10

You are loading richtext into the field so it is not as easy as setting the rawvalue like you have above. You will have to create an xHTML equivalent of what you want to load and then load it into the field when you are ready. The easiest way I have found to do this is to create what I want in a field then to get what the xHTML that represents that do a console.println(fieldname.value.exData.saveXML(); This will copy the xHTML to the javascript console. Then you can see what it looks like and adjust as you see fit .....when you are ready to load it again you would use fieldname.value.exData.loadXML(string that holds the xHTML, 1, 1); The two other paraneters that you pass determine whether to concate with what is there or overwrite it ...this is documented in the loadXML command.

Hope that helps

Paul