Jump to content

hellsing

Members
  • Posts

    1
  • Joined

  • Last visited

hellsing's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi All, Could you guys suggest how to call a function to resize fieldsets to equal height when the validation plugin puts an error message? I have a fancy form made of 3 fieldsets side by side, and a simple code makes their height equal. It goes like this: function eqHgt(){ var hght = 0; $('.column').each(function() { // all fieldsets have 'column' class if($(this).height() > hght) { hght = $(this).height(); } }); $('.column').height(hght);} The form is validated by the jQuery Validation plugin. The problem is that when the plugin finds some invalid fields, it puts error messages in label elements under those fields and the content of the fieldset overflows. It would make the wrapping fieldset one or more lines higher, but it can't grow because my function eariler gave a fixed height to all the 3 fieldsets. In this situation it's useless if I run the eqHgt again because it looks for the tallest element without avail. I tried to put a new line into my eqHgt function immediatelly after the 3rd line ($('.column').each...): $('.column').height('auto'); ...so in my logic it would let the fieldsets to grow to the size their content dictate and then record the new size but it doesn't work. I must say I have no idea why. Maybe the problem is that I bound eqHgt to an improper event. I tried to use #myform.change, .column.change and in invalidHandler function of validation plugin. Your help would be highly appreciated.
×
×
  • Create New...