Changing Font size and type face for all field??

Avatar

Avatar
Validate 1
Level 1
chrisb29762052
Level 1

Likes

0 likes

Total Posts

25 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
chrisb29762052
Level 1

Likes

0 likes

Total Posts

25 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile
chrisb29762052
Level 1

13-05-2015

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?

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
chrisb29762052
Level 1

Likes

0 likes

Total Posts

25 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
chrisb29762052
Level 1

Likes

0 likes

Total Posts

25 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Affirm 1
View profile
chrisb29762052
Level 1

13-05-2015

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.