-
1. Re: Validate SSN
Srini Dhulipalla Jun 4, 2010 8:44 AM (in response to meem23)Here is a sample file for you..
https://acrobat.com/#d=lBhs6fLfzaWMUCMd0R5Vvg
Let me know if this helps..
Thanks
Srini
-
2. Re: Validate SSN
meem23 Jun 4, 2010 8:49 AM (in response to Srini Dhulipalla)I'm not able to open your sample without updating my flashplayer and unfortunately our IT doesn't want us to upgrade yet.
-
3. Re: Validate SSN
Srini Dhulipalla Jun 4, 2010 9:45 AM (in response to meem23)Send a test email to LiveCycle9@gmail.com (OR) send a personal message in the forum, so I can send the file to your email..
Thanks
Srini
-
4. Re: Validate SSN
jweizenblut Sep 10, 2010 12:12 PM (in response to Srini Dhulipalla)Can you also send me information on how to do this?
-
5. Re: Validate SSN
meem23 Sep 10, 2010 12:24 PM (in response to jweizenblut)Hi, This is what I used.
1) Create a Script Object with the name "globalFunctions".
2) Place the below script in the script object..
function isValidSSN(SSNstr){
var ssnChar = "-";
var strMessage ="";
var pos1=SSNstr.indexOf(ssnChar);
var pos2=SSNstr.indexOf(ssnChar,pos1+1);
var strFirst=SSNstr.substring(0,pos1);
var strSecond=SSNstr.substring(pos1+1,pos2);
var strThird=SSNstr.substring(pos2+1);
//xfa.host.messageBox("First = " + strFirst + " Second = " + strSecond
+ " Third = " + strThird);
if(strFirst.length !=3 || strSecond.length != 2 || strThird.length !=
4){
return "Not valid SSN";
}
else
return "Valid SSN";
}
3. Place 2 text Fields on your form.
4. In the properties of one Text Field, place the below pattens.
Display: text{999-99-9999}|text
Edit: text{999-99-9999}
In the Change event of the field, place the below script.
if (xfa.event.change.match(/[0-9\-]/) == null)
xfa.event.change = "";
In the Exit event of the field, place the below script.
var strReturnMessage = globalFunctions.isValidSSN(this.formattedValue);
if(strReturnMessage != "Valid SSN"){
xfa.host.messageBox("Please enter SSN as 999-99-9999 or 999999999");
xfa.host.setFocus(this);
}
-
6. Re: Validate SSN
jweizenblut Sep 10, 2010 1:39 PM (in response to meem23)Thank you so much.
If I may, got a question on how to do 2 things.
1st. Can I create a button in the PDF that when I click on it, will open
Internet Browser and go to URL I specify?
2nd. Same as above, but can I have it do a form post to the URL I specify
and post certain values only instead of the whole form? Then, display the
results on the Internet Browser. The PDF remains open in the background.
If you can point me in the right direction, I would really appreciate it.
Thanks!

