Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-11
10
Medium Priority
?
245 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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

688 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