Javascript question-Adobe X Pro
I have a form that we enter the social security number in three different fields at the beginning of the form and then combine those into one field for auto insertion into other fields later in the form.The coding listed below works real well except when you enter something like 123 04 5678 it shows 123-4-5678. We need that missing zero to show. I have spent hours looking on the web and have tried things like "toString in the "this.getfield' line, padding the fields with blanks, and others on this website and nothing works. If anyone has any suggestions on how to get the right output it would be greatly appreciated.
var three = this.getField("Social Security");
//this function that checks if the destination field is blank and if so popluates it.
function collatePreSetFieldsTo(populate){
//always overwrite the value in populate field
//if(populate.value==''||populate.value==null){
var one = this.getField("SSF");
var two = this.getField("SSM");
var three = this.getField("SSL");
populate.value=one.value + '-' + two.value + '-' + three.value;
//}
}
collatePreSetFieldsTo(three);
