Jump to content

Auto-populating a form


bcournoyer

Recommended Posts

I have a form where, based on a dropdown, I would like to auto-populate all the other fields in a form. Is there a way to target individual fields in the form or the pdf?

 

I've tried Field("fieldname") = "blah"; but it appears to be a one way street. You can only read the field and output to the pdf field the rule is assigned to. Anyone know a way around this?

 

Bill

Link to comment
Share on other sites

Since you are talking about dropdowns, you may want to post this question in the MarcomCentral section of the forum where you might get more applicable answers to your question. From a generic JavaScript perspective, I would think you would want to set up a SWITCH loop to populate other parts of the form based on the specific value chosen in the dropdown. If the value in the dropdown feeds the field "type" your switch statement might look something like:

switch (Field("type")) {
  case "blah":
  // set field("XYZ") to ...
  // set field("ABC") to ...
  break;

  case "yada yada":
  // set field("XYZ") to ...
  // set field("ABC") to ...
  break;

  // etc.
}

Of course, not knowing anything about how to set up a web page in Marcom Central, I'm not sure of how to apply this logic to that product.

Link to comment
Share on other sites

When you say "set the fields" are you referring to a data field or a web page field? I'm assuming you are referring to the latter in which case I'm of no help as I'm not familiar with the MarcomCentral product. All the JavaScript I work with is run when a record is composed; not when a selection is made on a web page. :)
Link to comment
Share on other sites

Using JS I want to set the data field in the pdf being generated. I can set that in the field the rule is attached to by using return "", but I want to set multiple fields. As a bonus I would also like to populate the fields in Marcom as well.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...