Skip to Main Content

Add style to form item with jQuery after validation error

I did see in OTN APEX forum question how to highlight an item based on a validation. I have made the solution earlier for that and discussed topic in other post.

I just wrap up solution now here.

If you are on APEX 3 load jQuery library on your page template header.

Go to Shared Components > Templates and filter report by Type "Label".
Copy your favorite label template to new name and edit it.

Add to "On Error After Label" JavaScript that modify your item. E.g. add jQuery UI error state class:

<script type="text/javascript">

Or you can define styles using jQuery css method e.g.:

<script type="text/javascript">

Change form items to use your new label template.

Marko reminding me that validations Error message display location must be set to "Inline In Field" or "Inline In Field and In Notification"..


  • Speed99 27 May 2011
    Hi, I was searching for it. Perfect solution. Thanks :D
  • Jari Laine 20 Apr 2011

    Hi Marko,

    Thank you for informing this. I will update post.


  • Marko 20 Apr 2011
    You forgot to mention that this will only work if we have display error location set to "Inline In Field" or "Inline In Field and In Notificatio". Br, Marko