Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Adding javascript to Print Form button

Avatar

Level 4

Using the Script Editor, can I convert this javascript so that it will fire on MouseUp on the Print Form button? The Designer file is attached for reference.

newDocName = "";
f1 = this.getField("topmostSubform[0].Page1[0].Last_Name[0]").valueAsString;
if (f1!="") newDocName += f1 + " ";
f2 = this.getField("topmostSubform[0].Page1[0].First_Name[0]").valueAsString;
if (f2!="") newDocName += f2 + " ";
f3 = this.getField("topmostSubform[0].Page1[0].Date[0]").valueAsString;
if (f3!="") newDocName += f3 + " ";
f4 = this.getField("topmostSubform[0].Page1[0].Email[0]").valueAsString;
if (f4!="") newDocName += f4;

newDocName = newDocName.replace(/[\\,\/,\:,\*,\?,\",\<,\>,\|,\,,\n,\r]/g,"");

docPath = this.path+"";
docPath = docPath.substring(0, docPath.lastIndexOf("/")+1);

mySaveAs(this,docPath+newDocName+".pdf");

0 Replies