Solved

Copy "actions" in form fields - **URGENT NEED HELP**

Posted on 2004-08-11
10
244 Views
Last Modified: 2012-06-22
I am creating a large amount of form fields in Acrobat 5.0.  Is there a way to copy the "actions" from one check box (or any form field) to another?  Many have the same actions and creating the same actions for 9 checkboxes is a bit tedious.

TIA.
0
Comment
Question by:Anjinsan5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 

Author Comment

by:Anjinsan5
ID: 11773936
by the way - i do understand that creating a single box, adding all actions, then copying it will copy the actions - but the forms are already there so I needed a way to easily simply copy properties from one to the other

/.nick
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11774118
I was just about to tell you that you can copy the form fields with the actions, then I did a refresh, and found your second comment...

You can use JavaScript to set an action, but you cannot retrieve the action from a field. So, if you can code the action in JavaScript, you can then apply it to existing fields. You would do this with setAction() method of the FIeld object.
0
 

Author Comment

by:Anjinsan5
ID: 11774488
Unfortunatly JS is not my forte - is there a way to show/hide fields on mouse up via JS?

/.nick
0
Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

 

Author Comment

by:Anjinsan5
ID: 11774679
basically i just need the syntax - if it exists
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11775273
I think you misunderstood me: You can write a JavaScript to assign any action to a field. You can store this JavaScript on the application level, and e.g. execute it with a menu item in one of Acrobat's menus.

It doesn't make a lot of sense to try to come up with some code, not knowing what your exact problem is. Can you please provide a little more information about what you are trying to do. I'll be glad to give you JavaScript samples, or work with you so that you can come up with the solution, but I need more informaiton.
0
 

Author Comment

by:Anjinsan5
ID: 11775925
Basically I have the problem that certain fields need to be hidden and/or shown based upon check box or radio button selections (i.e. if Serial Comm is checked, serial comm properties become shown, if Parallel Comm is checked, serial get hidden, parallel comm settings fields will be shown).  It's easy to do this from within each single radio button (on mouse up, show/hide form fields).  Is there a way to do this in JS so i can cut and paste JS code and not continually select individual fields and assign the same properties to a number of check boxes?

/.nick
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11789188
This sounds like copying the actions would not help: The action that is associated with a checkbox is specific to this box, and cannot be used for a different checkbox: The fields that would be enabled or disabled is specific to a checkbox.

You can use JavaScript to enable/disable fields: Add this JavaScript to the MouseUp action:

var f_hide = this.getField("TextToHide");
var f_show = this.getField("TextToShow");
var thisField = this.getField(event.targetName);

f_hide.hidden = (thisField.value == "Off");
f_show.hidden = (thisField.value == "Yes");


This is what's going on in these few lines:
You first create two variables for the fields you need to show or hide (TextToHide and TextToShow in this case). You also create a variable for the current checkbox (we do this by using the targetName for the current event).

In the second part, you are assigning a boolean value to the "hidden" property of the two fields.
0
 

Author Comment

by:Anjinsan5
ID: 11792455
I apologize for any confusion - let me further explain what I am trying to accomplish.

I am creating hardware setup sheets for my company's products.  In one section there is a set of radio buttons to select a Communication protocol to use:

Modbus
PC Link
SYNC

When you select one of these, the characteristics of each protocol must also be filled out.  So basically, if they select Modbus, I want the entire SYNC section to be hidden and the PC Link section as well.  If they pick PC Link, hide the other 2 section's fields, etc....  I just want to only allow users to fill out details of the sections they actually select.  There are other sections with radio buttons where the user can pick one of three choices, HEAT COOL RUN...if they select HEAT or COOL, more selections need to be filled out (so i want to show them) but if they pick RUN, i want to hide those fields.  Basically I want to make it impossible to fill the form out wrong.

I hope this helps.

/.nick
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 11801073
Let's see if we can make this work:
Do you know how to create radio buttons? If so, create three buttons for Modbus, PC Link and SYNC. Use the export values 0, 1, and 2. Create a Mouse Up action to run a JavaScript and add this to every button (it's the same for all three radio buttons):

selectFeature();

Then create a document level JavaScript (Advanced>JavaScript>Document JavaScript) with the name "selectFeature" and paste these lines into the edit box:

function selectFeature()
{
   var f = this.getField("Feature");
   console.println("setting value " + f.value);
 
   // f.value contains the currently selected setting of the check boxes
   var selection = f.value;

   // Modbus (setting == 0)
   f = this.getField("modbus_1");
   f.hide(selection != 0)
   f = this.getField("modbus_2");
   f.hide(selection != 0);
   
   // PC Link (setting == 1)
   f = this.getField("pclink_1");
   f.hide(selection != 1)
   f = this.getField("pclink_2");
   f.hide(selection != 1);

   // SYNC (setting == 2)
   f = this.getField("sync_1");
   f.hide(selection != 2)
   f = this.getField("sync_2");
   f.hide(selection != 2);

}

Replace the names that I used for the different fields (e.g. pclink_1 and pclink_2) with the fields you want to hide/unhide.
0
 

Author Comment

by:Anjinsan5
ID: 11840854
thanks so much!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question