Forum

Thread tagged as: Question, Forms

Form field validation using regex?

Hi,

I'd like to validate a field server-side using regex in your Forms app, but can't find any reference to this being possible?

Can someone please let me know if they've achieved this?

Jon Young

Jon Young 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use the pattern attribute, as with HTML5 form inputs.

Hi Drew,

The pattern attribute isn't compatible with IE8, IE9 or Safari unfortunately.

I just need to ensure a field is empty prior to submitting the form.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's compatible with Perch. The validation is done on the server.

Oh, ok, brilliant. Thanks very much Drew.