Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adobe LiveCycle ES2...simple question

Status
Not open for further replies.

conneticat

Programmer
Jul 16, 2004
47
US
I occasionally use LiveCycle to create simple online fillable forms. For one form, users put the information on the first page, and it propagates throughout the document. There are borders around the fields...I'd like these fields to NOT print (no border, nothing) if the user leaves it empty. Can't seem to figure this out! I want the borders, otherwise!

cat.gif
 
a) make a "Print" button
b) put a JS behind that button that sets the "visible" property of every empty field to "false" and then executes the print commmand
;-)

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
That sounds brilliant, but way beyond me. Can you be specific, like where and what? There's actually only one field that might be blank.

cat.gif
 
I have no actual experience with LifeCycle so I do not know whether this would really work the same way, but here's how I do such things in Acrobat Pro:
- Create a print button on the first page (or any other page that makes sense)
- Assign an action to that button, make it a Javascript action
- Enter the following script, adjust where necessary:
Code:
hideEmpty(); 
function hideEmpty() 
{ 
 var j; 
 j=0; 
 for (var i=0;i<this.numFields;i++) 
 { 
  var fName=this.getNthFieldName(i); 
  var f=this.getField(fName); 
  if ((f.type != "button") && (f.value.length<1)) 
  { 
   f.display = display.hidden;  
  } 
 } 
app.doc.print();   
}

- Maybe duplicate the scripted button and put it on the very last page also.

Good luck!
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top