public boolean validateHSN()
{
boolean ret = true;
int i = strLen(this.HSNCode);
TextBuffer txt = new TextBuffer();
str msg = this.HSNCode;
txt.setText(msg);
txt.regularExpressions(true);
if (ret)
{
if (i == 4 || i == 6 || i == 8)
{
ret = true;
}
else
{
ret = checkFailed("Enter 4 0r 6 or 8 digits only");
}
}
if (ret)
{
if (txt.find("^[0-9]+$"))
{
ret = true;
}
else
{
ret = checkFailed("Enter only numbers");
}
}
return ret;
}
No comments:
Post a Comment