public boolean validateField(FieldId _fieldIdToCheck)
{
boolean ret;
int q;
int ascii;
int i;
q= strLen(this.Phone);
ret = super(_fieldIdToCheck);
if(this.Phone)
{
for (i=1; i<=q; i++)
{
ascii = char2num(this.Phone, i);
if( ascii >= 48 && ascii <= 57)
ret = true;
else
{
ret = false;
error(‘Phone Number must be numeric only’);
break;
}
}
{
boolean ret;
int q;
int ascii;
int i;
q= strLen(this.Phone);
ret = super(_fieldIdToCheck);
if(this.Phone)
{
for (i=1; i<=q; i++)
{
ascii = char2num(this.Phone, i);
if( ascii >= 48 && ascii <= 57)
ret = true;
else
{
ret = false;
error(‘Phone Number must be numeric only’);
break;
}
}
if(q!=10)
{
error(‘Phone Number must be of 10 digits’);
this.Phone = “”;
this.insert();
}
}
{
error(‘Phone Number must be of 10 digits’);
this.Phone = “”;
this.insert();
}
}
return ret;
}
No comments:
Post a Comment