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
https://forums.phpfreaks.com/topic/142691-js-in-acrobat-triming-0s/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.