Because copy and paste bring the font size and type with it I want to create a script that change it
I tried to make happen at the "exit" function of the the field as follow :
form1.TestPage.Subform1.TextField1.font.size = "10pt";
form1.TestPage.Subform1.TextField1.font.typeface = "Myriad Pro";
I also tried a button that find all field by modifying a script that I found on line but it doesn't work for me:
function ProcessTextEdit(oField)
{
}
function ProcessAllFields(oNode)
{
if (oNode.className == "subform" )
{
// Look for child fields.
for (var i = 0; i < oNode.nodes.length; i++)
{
var oChildNode = oNode.nodes.item(i);
ProcessAllFields(oChildNode);
}
}
else if (oNode.className == "field")
{
switch (oNode.ui.oneOfChild.className)
{
case "textEdit":
if(oNode.parent.className == "Subform")
{
form1.TestPage.Subform1.TextField1.font.size = "10pt";
form1.TestPage.Subform1.TextField1.font.typeface = "Myriad Pro";
}
}
}
}
No luck. Any suggestions?
Solved! Go to Solution.
Views
Replies
Total Likes
I was trying to only control font size and type while allowing users to keep the flexibility to use color, bold, underline, etc to highlight some of the information when bringing there text over. Plain text does allow for it. So far, from all that I have read , this is not possible because Livecycle is not able to control the attribute of Rich Text from Word being imported into a Rich Text box in Livecycle.
Views
Replies
Total Likes
is this a one time change? if so it is probably easier to make the changes by selecting the fields and changing the fonts.
Views
Replies
Total Likes
No. I understand that you can set font in Lifecycle. The fact is that when you use Rich text in your form and you copy and paste information from another source (ie: word documents,etc), the font attributes come with it. The form that I am creating will rely on cutting and pasting information from other sources. I don't want to end up with different font size and type once the form is completed. The only way I can see this happening is by running a script against all text fields to ensure that it is the same all across the form.
Views
Replies
Total Likes
How many of the fields are RTF? you could put it on an exit script once the user leaves the field. That is easy enough if there are only a couple marked as RTF
Views
Replies
Total Likes
Tried that. It will not apply against information that has been cut and pasted. Only against information type directly in the field.
Any other suggestions?
Views
Replies
Total Likes
2 other options that may help
1- Do not make the field RTF. That way the copy and paste will be whatever the field properties are set for
if that will not work...
2- have a duplicate field that is hidden and not RTF. Use a script such as this.rawValue = otherfield.rawValue. Then on the save or print action hide the RTF and make the none RTF field visible. This could be a pain if there are multiple fields.
Views
Replies
Total Likes
Try using:
this.format() in the exit event.
Views
Replies
Total Likes
Unless you can prove me wrong (I would like to be) the script doesn't work against text that has been cut an past from Word.
Views
Replies
Total Likes
You have to change the field format to 'Plain Text Only' and use this.font.size = "xxpt"; on exit
You can then copy and paste text from MS Word into the Form and it will convert it to the same font size that you have selected
Views
Replies
Total Likes
I was trying to only control font size and type while allowing users to keep the flexibility to use color, bold, underline, etc to highlight some of the information when bringing there text over. Plain text does allow for it. So far, from all that I have read , this is not possible because Livecycle is not able to control the attribute of Rich Text from Word being imported into a Rich Text box in Livecycle.
Views
Replies
Total Likes
You are correct - that is one of the shortfalls of Livecycle in that it does not allow you to have the same flexibility as Word
Views
Replies
Total Likes
Views
Likes
Replies