Previous | Next | (P-PDF) JavaScript
Topic: Postal Code
Conf: (P-PDF) JavaScript, Msg: 28771
From: lephung
Date: 10/19/2001 05:07 AM
I write postal code for my client, My postal is A#A #A#. I write the scripts in validation
function check()
{
var pcode=this.getField("PostalCode");
var pcode=event.value;
var stringofLength=pcode.length;
if (stringofLength==0)return;
if (stringofLength<6){
app."Please enter Postal Code in the format A#A #A#");
event.rc=false;
}
else{
// Insert space if there isn't one already
if (pcode.indexOf(" ") == -1)
event.value = pcode.substr(0, 3) + " " + pcode.substr(3, 7);
}
}
check();
my script in format
event.value=util.printx("A9A 9A9",event.value)
I don't know what happen, I can validate for 5 digits only if i enter 6 digits. I couldn't format the text will capture everything.
Do I miss anything in my script. Thank you for your help.
Cindy