bcournoyer Posted May 3, 2010 Share Posted May 3, 2010 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 More sharing options...
esmith Posted May 3, 2010 Share Posted May 3, 2010 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 More sharing options...
bcournoyer Posted May 3, 2010 Author Share Posted May 3, 2010 I understand the switch, but I'm looking for how to set the fields. That's why I posted it in JS. Any idea how to set the field using JS? Link to comment Share on other sites More sharing options...
esmith Posted May 3, 2010 Share Posted May 3, 2010 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 More sharing options...
bcournoyer Posted May 3, 2010 Author Share Posted May 3, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.