DBookatay Posted January 27, 2009 Share Posted January 27, 2009 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... Quote Link to comment Share on other sites More sharing options...
DBookatay Posted January 28, 2009 Author Share Posted January 28, 2009 Anyone? Does anyone know how to stop java script from trimming off the 0? Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 28, 2009 Share Posted January 28, 2009 post your entire function; that you are using to accomplish this task. Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 28, 2009 Share Posted January 28, 2009 Treat those numbers as strings. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.