Validation plugin: append custom html on error
Hi all,
I am using the validation plugin and I want to append <div class="error">message</div> after my input element when there is an error. I do not want the input field to have a class error attribute added to it.
I have tried modifying code from the docs but I endup appending a duplicate copy of my input field as the message.
I guess I need to modify errorPlacement:
- errorPlacement: function(error, element) {
- if ( element.is(":checkbox") ){
- error.appendTo ( element.next() );
- } else {
- error.appendTo( element.next() );
- }
- }
any help would be appreciated
thanks