Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all 12130 articles
Browse latest View live

Keep Text in Uppercase

$
0
0

I am using Adobe Acrobat 9 Standard. I have script to change lowercase to uppercase in many form fields on a PDF. But if I return to the field that has already changed lowercase to uppercase, it goes back to lowercase until I exit the field again. These fields are used a lot to copy and paste into other applications and I want the fields to remain in uppercase once they are converted.

 

Please help!

 

I am using this to convert to uppercase: event.value = event.value.toUpperCase();

 

Thanks,

Brandy


NotAllowedError: Security settings prevent access to this property or method.

$
0
0

hey guys,

     I'm getting this error when I click in the check box in adobe. do I have a settings issue or a syntax issue or what? can anyone help?

 

NotAllowedError: Security settings prevent access to this property or method.

  1. Doc.insertPages:4:Field Check Box6:Mouse Up

 

Here is the code

  1. this.insertPages({

nPage : -1,

cPath : "/G/SYNC/TEMP PM/M2T3/P10779-C.pdf",

nStart: 0

});

Why Doesn't My Code Work?

$
0
0

I am trying to make it so if a user checks a radio button within a group of 2 (Choice1 & Choice2) the formula within the field "Total" changes.

 

This is the javascript within the field "Total"

 

//////////////////////////////////////////////////////////////////////////////

if(document.Group1('Choice1').checked)

{

event.value = (this.getField("WSAtotal").value + this.getField("SAandAdd").value);

}


else if(document.Group1(Choice2').checked)

{

event.value = (this.getField("NSAtotal").value + this.getField("SAandAdd").value);

}

//////////////////////////////////////////////////////////////////////////////

 

P.S. I don't know anything about javascript so I have just been Frankensteining this code from around the web.

Need Help Creating Custom Calculation Script Please

$
0
0

Untitled-1.jpg

Hello,

 

I am in desperate need of a custom script here if anyone knows how to do it. I essentially want the percentage field to automatically fill in based on the fraction, rounded to the nearest integer, show "0" if F2 is "0", and not display "NaN" before it's filled out. I also do not want the error message to pop up "The value entered does not match the format of the field [ P ]"

 

F1 and F2 will always be a whole number between 0-9, and P will always be a whole number between 0-100.

 

I've been using (F1/F2)*100 as a Simplified Field Notation, but it keeps showing decimals and displaying "NaN" when nothing has been entered in F1 and F2. Any gurus out there that could help me? I'd really appreciate it. Thanks

Need to create date/timestamp or watermark when printed.....

$
0
0

I want to be able to have the time/date printed out on a pdf when it is printed. I could be as a header/footer or a watermark. It doesn't really matter. Is this possible? Can it be done in adobe reader. I need to do this on networked pc's and I just want them to print the pdf and it automatically print the date and time on it. The networked pc's only have adobe reader.

 

Thanks!

Script to Insert a Custom Stamp/Annotation

$
0
0

Hello,

 

I have created a new custom stamp and need to add a script to "Batch Processing" to insert this stamp on 1,000 drawings.

 

The sample script available from the JavaScriptfor Acrobat API Reference inserts a stamp from the "Standard" Stamp File.

 

The standard stamp file is located in the following directory:

 

C:\Program Files\Adobe\Acrobat 8.0\Acrobat\plug_ins\Annotations\Stamps\ENU\Standard.pdf

 

The script needs to be modified to insert a stamp from a custom stamp menu called "Doc Control" and the custom stamp name is "Received".

 

The actual file which contains the custom stamp is located in the following directory:

 

C:\Documents and Settings\username\Application Data\Adobe\Acrobat\8.0\Stamps\Doc Control.pdf

 

 

Please find below the script which needs revising to include the new custom stamp.

 

 

var annot = this.addAnnot({

page: 0,

type: "Stamp",

name: "myStamp",  rect: [400, 400, 550, 500],

contents: "Received Stamp!",

AP: "NotApproved" }); This part of the script needs revising to refer to the new custom stamp not the stamp in the standard stamp file?

 

Any assistance will be greatly appreciated - Thank you.

 

 

 

 

 

 

 

How can I separate the parts of a date dd/mm/yyyy so that I can fill three separate text fields?

$
0
0

Working around the escape character "/".  Unfortunately, the original date is fixed-- it comes from a company's website--  so I cannot scratch the variable and set up with double back slashes. 


I've tried .substring and .slice too so maybe there's an additional error


Please help!

Custom Format Script Help

$
0
0

I am not too familiar with scripting but am hoping someone can provide some guidance or at least somewhere online that will show me how to do this.  Here's what I'm trying to do:

 

I have a text field that I need users to enter a specific number format in.  They have three choices of formats but only one type must be entered.  If I go by the arbitrary format options, they would look like this: 99-9999999OO, 999-99-9999, or 999999-99999.  Now, is there a way to write a script so that it forces the user to enter the text/number in one of those three formats only?  I am able to set up an arbitrary mask and get one of them but I need to provide options to the user.

 

If there is some good reading online where I can figure this out myself, let me know.  Otherwise, any input would be greatly appreciated.

 

Thanks,

 

Dustin


How to run script on Adobe Acrobat 9 Pro

$
0
0

HI all i'm new to Adobe Acrobat 9 Pro Scripting, and I'm hoping someone can help me how i can run any javascript on Adobe Acrobat 9 Pro.  I have no idea which place (location) take script then run.

 

 

Like Adobe InDesign CS4 script location=>

Application>Adobe InDesign CS4>Scripts>Scripts Panel>JavaScript

 

 

Run Path =>

Window>Automation>Script then run

 

Any insight is appreciated!

Thank you so much adv.

[email address removed by host]


How do I add variables to different checkboxes without using the 'Export Value' and then add them together (if checked)?

$
0
0

Hello,

 

I am very new to JavaScript.  I would like to create a checkbox with a numerical value variable activated if the box is checked.  Unfortunately, I cannot use the 'Export Value' because I already need to use it for something else.

 

Any help is really appreciated.

 

Thanks,

 

Robyn

very new trying to make conditional required text

$
0
0

Very new at this. I am trying to create a conditional required text and hide certain boxes after filled out but still be able to access them when they are sent back to me.

 

can anyone help?

can't select fields for calculations

$
0
0

someone suggested I try this section.

 

 

Hi

 

I am using acrobat 9 pro and i can't slect field for calculations.

 

I can select all of them by clicking on select all and can deselect all.

 

but I cannot choose individual fields.

 

TIA

Rename check boxes

$
0
0

Hi, in my form has 6 pages & lot of check boxes are duplicated. i want to add some unique name to all check boxes. i don't want to use currant name & any name can use. i hope using javascript this problem can solve. pls give me a code for this. thanks..

Dialog 'Save As', 'Print' return value

$
0
0

Hello,

is it possible to get return value of these dialog boxes? I create forms in Adobe Livecycle ES2 and from xfa.host.messageBox I can get 4 values to each answer.

 

Thanks you.

How can I export adobe form data to FDF?

$
0
0

Hi.

 

I am new to programming for acrobat and I have a very simple task.

 

I already have an FDF that contains values for various form fields.

I can automatically populate the form fields just by pulling up the FDF for the associated PDF in Adobe Reader - no problem.

 

When the user saves the data, I need to export it to FDF - that is the problem.

This is not a server app - it is a desktop app.

 

Can someone please point me in the right direction or provide some sample code?

 

Thanks!


Do I need to use javascript to get a text field in a PDF form to aut fill with current/today's date?

$
0
0

I have a form for booking appointments and would like the date field to automatically fill with

today's date and to print. I have set the text field's format to "Date" and when I place the cursor into the

date field, today's date shows. It disappears as soon as I tab to the next field.

 

Does this action require a javascript script to fill and print today's date? If so, where do I find that?

 

Or is there another way to format the text field (besides typing today's date) to get the current date?

 

Thanks.

Ali

 

using iMac 2.93 GHz Intel Core 2 Duo 8 GB | OS Snow Leopard 10.6.8 | Acrobat Pro 8

Having issues with populating a Text Field with data from 2 other fields

$
0
0


I have 3 fields Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.

 

Tools_1a_pri is a drop down combo with a predefined list. One of the options is "Other".  When "Other" is selected, the text field Tools_1a_pri_other becomes visible for users to enter the name of the other tool.

 

The Tools_1a_pri_txt is a text field with a calculation that shows either text stating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.

 

When I select one of the predefined tools, everything works.  When I select other, it appears that nothing has changed.  It requires that I click on another field before it populates.  This is confusing to the user.

 

Tools_1a_pri   Validate code
this.getField("Tools_1a_pri_Other").display = event.value=="Other" ? display.visible : display.hidden;

 

 

Tools_1a_pri_txt  Calculation code
//if nothing is selected, do the following
if (getField("Tools_1a_pri").value.length < 2) {
event.target.textColor = color.red
event.value = "No primary tool identified";
}else if (getField("Tools_1a_pri").value != "Other") {
//otherwise do this if other is selected
event.target.textColor = color.black
event.value = getField("Tools_1a_pri").value;
}else if (getField("Tools_1a_pri").value = "Other") {
//otherwise do this if other is not selected
event.target.textColor = color.black
event.value = getField("Tools_1a_pri").value + " - " + getField("Tools_1a_pri_Other").value;
}

Initializing a variable at docOpen

$
0
0

My form needs to create an array, sort it and put it in a variable that might need to be used anywhere on the form.  I want this variable to be initialized upon opening the document.  Is there a way to make a variable global from a docOpen() function for example?

How to run script on Adobe Acrobat 9 Pro

$
0
0

HI all i'm new to Adobe Acrobat 9 Pro Scripting, and I'm hoping someone can help me how i can run any javascript on Adobe Acrobat 9 Pro.  I have no idea which place (location) take script then run.

 

 

Like Adobe InDesign CS4 script location=>

Application>Adobe InDesign CS4>Scripts>Scripts Panel>JavaScript

 

 

Run Path =>

Window>Automation>Script then run

 

Any insight is appreciated!

Thank you so much adv.

[email address removed by host]


Remove 0 Value in Calculated Field

$
0
0
I copied the below question for another post here as it asks the question perfectly.

"I set up an invoice form to calculate totals from quantity x unit price. Every line has this formula, however the users may not have a priced item on every line of the form. My total column shows a $0.00 value until I input data. I'd rather have nothing show in that column unless quantity and price are entered. Is that possible?"

However, and I apologize, but I don't understand the answer that was posted. This is the first time I've needed a calculated field -- and I've not done scripting in Acrobat before.

Can someone walk me through the exact steps of how to enter and what to enter in the form to remove "0" values from the form?

Thanks, in advance, for any and all help.
Viewing all 12130 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>