Hi, Before I switched over to lifecycle, I created a simple function for date entry edits. This function had 2 purposes;
A. take a full date and convert it to the DDMMMYYYY format AND
B. take a partial date and convert it to the MMMYYYY format.
I don't know if there is an easy way to do that without functions, but i have been playing around with lifecycle for a few hours now, with no results. This function did work with Acrobate PRO 8. I am not sure if the code would work with lifecycle and i am either further confused on how to call a function in lifecycle.
I'm sure this function could be done a heck of a lot easier, and with less work, but I havn't written code in about...4 years, so getting back into it is tough (and even then it was C# and ColdFusion)
~+~+~+~+~+~+~+~+~+~+~
function fixDate()
{
//----Variable assignment----
var fieldValue= event.value;
var myArray = fieldValue.split("/");
var monthName= new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
myArray[0] = monthName[myArray[0]-1];
//----end Variable assignment
//----set year prefix to '20' if last two didgets are less then 16----
if(myArray[2].length < 3)
{
if(myArray[2] <= 15)
{
myArray[2] = "20" + myArray[2];
}
else
{
myArray[2] = "19" + myArray[2];
}
}
//-----------------------------
//----add a 0 if single didget date is given----
if (myArray[1].length == 1)
{
myArray[1] = "0" + myArray[1];
}
//----If no Day is given----
if (myArray[1] == "")
{
// app.alert(myArray[0] + "/" + myArray[2]);
event.value = (myArray[0] + "/" + myArray[2]);
}
else
{
// app.alert(myArray[1] + "/" + myArray[0] + "/" + myArray[2]);
event.value = (myArray[1] + "/" + myArray[0] + "/" + myArray[2]);
}
}