jQuery validation errors with custom select wrappers

This was easy.

If an errored element has a parent called .custom-select, then insert after the custom select wrapper. Otherwise, proceed as usual.

errorPlacement: (error, element) ->
inserted = false
if <a href="http://element.is">element.is</a>('select')

customSelect = element.closest('.custom-select')
if customSelect.length &gt; 0
inserted = true

if not inserted

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s