Zipcode Character Validation

On the stage:
Textfield called “inputTXT”.
And a button called “Go”.

All I am trying to accomplish here is to have the input characters validated to be ONLY numbers and max 5. However, I don’t want to use:"inputTXT.restrict = “0123456789”.

Instead I would like to check if the characters entered after pressing the “go” btn, are within the defined parameters above (numbers and max5). If yes, then I need to pass a URL, if not then I need to display an error message.

I looked at so many solutions but none seem to have worked.

Thanks in advance for your support!