Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - set stroke color for array of fields
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

set stroke color for array of fields

 Post Reply Post Reply
Author
morrison View Drop Down
New Member
New Member
Avatar

Joined: 26 Jan 2015
Points: 32
Post Options Post Options   Quote morrison Quote  Post ReplyReply Direct Link To This Post Topic: set stroke color for array of fields
    Posted: 14 Apr 2016 at 1:39pm
If a condition is met to make an entire array of fields required, is it possible to set the stroke color for that array, or do the fields need to be named individually?

Let's say the array is as follows:
var aAgencyInfo = new Array("entity_name","entity_tin","entity_addr_street","entity_addr_city","entity_addr_state","entity_addr_zip","entity_lic_num","entity_lic_state");

Can I do something like this?  (I say "like" because the line in bold text below is not working.)

if(//condition is met)
{
  this.getField("t_js_agency_fields_req").required=true;
  aAgencyInfo.strokeColor=color.red;
}

Or do I have to set the color individually for each field, like this?

if(//condition is met)
{
  this.getField("t_js_agency_fields_req").required=true;
  getField("entity_name").strokeColor=color.red;
  getField("entity_tin").strokeColor=color.red;
  getField("entity_addr_street").strokeColor=color.red;
//etc., etc.
)

If the stroke color can be set at the array level, where did I go wrong with this?  aAgencyInfo.strokeColor=color.red;

Thanks in advance!
~morrison

Back to Top
Sponsored Links


Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1111
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 2016 at 2:36pm
Loop over the array and set the color individually for each field.
Back to Top
morrison View Drop Down
New Member
New Member
Avatar

Joined: 26 Jan 2015
Points: 32
Post Options Post Options   Quote morrison Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 2016 at 3:04pm
Thank you.  I'm not sure what you mean by "loop over the array". 
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4106
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 2016 at 3:21pm
Only if you had used hirearchial names like:

entity.name, entity.tin, entity.addr.street, entity.addr.city, etc.
Back to Top
morrison View Drop Down
New Member
New Member
Avatar

Joined: 26 Jan 2015
Points: 32
Post Options Post Options   Quote morrison Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 2016 at 3:39pm
Ah, no.  We can't use hierarchal names on the PDFs because a dot is recognized as the separator between table and column_name in the db.

So, without hierarchy naming, to change colors for an entire set of fields, one would have to do it the long way.  Shucks.  Was worth a shot.  Thank you for your help.  It makes sense now.
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4106
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 14 Apr 2016 at 5:51pm
As suggested it is possible to put the field names into an array and the use that array to control which fields have their property changed.

if(// statement) {
// list of fields to process;
var aAgencyInfo = new Array("entity_name","entity_tin","entity_addr_street","entity_addr_city","entity_addr_state","entity_addr_zip","entity_lic_num","entity_lic_state");
For(var I = 0; I < aAgencyInfo.length; I++) {
// process each field in array;
console.println("Field being processed: " + aAgencyInfo);
this.getFeild(aAgencyInfo).").strokeColor=color.red;
} // end for loop;
} // end condition statement

If needed you could add statements to output the field name being processed by the loop within the loop.




Edited by gkaiseril - 14 Apr 2016 at 5:53pm
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.