Display jquery-ui-tooltip when jquery-validation detects form errors (almost there)
I'm trying to display a
jquery-ui tooltip when
validation detects form errors. I can make it happen using the following code, but the effect is that
a new tooltip gets created each time validation fails. Any idea how I can either tell ui-tooltip to reuse the existing tooltip OR tell validate to clean up the old tooltip first?
- $('form').validate({
- errorPlacement: function(error, placement) {
- var text = error.text();
- placement.tooltip({
- content: function(){ return text; }
- }).tooltip('open');
- }
- });
Also, any general tips or improvement suggestions welcomed.