Jump to content

JS in Acrobat triming 0's


DBookatay

Recommended Posts

I am creating PDS's using Acrobat 9 and use javascripts to achieve certian functions, and js is taking 0's off of certian fields. Meaning if dte1 is "01", and dte2 is "05" and dte3 is "09" the result  of date comes out as "1/5/9", instead of "01/05/09".

 

Another example is this code, which combines "city" + "state" + "zip".

var co_city = getField('co_city').value;
var co_state = getField('co_state').value; 
var co_zip = getField('co_zip').value; 

if (co_city) {
    var co_add2 = co_city + ", " + co_state + " " + co_zip; 
} else {
    var co_add2 = " "; 
}

event.value = co_add2;

 

If co_zip starts with a "0" it doesnt display it.

Any help, I'd really apprechiate it...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.