Skip Navigation

[Resolved] Mark fields red if there's an error – ajax form

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nicholas 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#953457

Hello, I have an ajax form and I'd like to mark the fields red in case there's an error or a field doesn't pass form validation. How do I do this?

Regards,
Nick

#953705

There's not an easy way to do this because there is no CSS class or other targetable attribute applied to invalid fields in all cases (backend and frontend validation). The validation system and hooks will allow you to customize the error message shown in the form_messages field shortcode, but not the individual form element. Unfortunately that would require a level of customization that falls outside the scope of support we provide here in the forums.

#957989

Ok understood, thanks.
Can we make this a feature request maybe?

#958299

Yes feel free to submit a ticket using the "Suggest an improvement" option in the forums. Unfortunately I can't switch the type of ticket here.

#1074384

Thank you.