Complex Input Validation Question

I have a form field that should only accept numbers between 0-100, or -11 or -21. Any other number should not validate. Is this possible?

Thanks for any help.

You could use regex validation on the input Brad:

^(?:-11|-21|100|[1-9]?\d)$

Either using Wappler's own validation or as an example, adding it as a pattern to your current input:

<input
  type="text"
  name="score"
  pattern="^(?:-11|-21|100|[1-9]?\d)$">
1 Like

Oh! A regex ...... never thought of that. Sheesh. Is it beer o'clock yet?

That should work. Thanks once again.

1 Like

Brilliant! Such an easy solution right in front of me.

1 Like

You enjoy that beer Brad I'm going to scoff my RedBull ice-lolly! It is 42 degrees here right now and it is 19.30!

:hot_face:

2 Likes