Expand my Community achievements bar.

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
Former Community Member

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

3 Replies

Avatar

Former Community Member

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
Former Community Member

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

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----