I'm fully aware this is an old post, and you've probably fixed it by
now, but I needed to do the same thing and found this via Google. This
is what I came up with:

errorPlacement: function(error, element) {
                var next = element.next().attr('class');

                if ( next == 'ui-datepicker-trigger' )
                        error.insertAfter(element.next());
                else
                        error.insertAfter(element);
}

I imagine there's better ways mind.

On Aug 28, 11:35 pm, Erich93063 <erich93...@gmail.com> wrote:
> I have a form where I am using the jquery validation plugin. In that
> form, I have a date field that is using a jquerydatepickerplugin so
> a small calendar gif immediately follows the date field. The date is
> required. The problem is when the field fails validation, the error
> message appears directly after the date input pushing the calendar gif
> to the right of the error message. I know there is anerrorPlacement
> parameter that you can use, but isn't that for every field in the
> form? How can I get the error placement to go after the calendar gif
> just for the date field. Here is my test code. I am also using an AJAX
> form submission plugin. The name of my date field is startDate.
> THANKS!
>
> $("#myForm").validate({
>                 submitHandler: function(form) {
>                         $('#myForm').ajaxSubmit(function(){
>
>                                 alert('SUCCESS');
>
>                         });
>                 }
>
>         });

Reply via email to