I want to fold a section of the form without setting its display
to none
. If i set the display
to none
, the validation is bypassed that is why I don't want to set the display
to none
. I know I can set the visibility to hidden
and visible
but this solution is not feasible for rendering the view as the space for the folded section stays there. This results in a very odd look of the view with an empty white space with no content on it.
So my question is to hide a section of the html form (without intacting a placeholder for it) without setting its display
to none
, so that I could still perform the validation.
Some HTML code:
<td style="margin: 5px; border-bottom: 1px solid; display:none; overflow: hidden;" colspan="3">
<div>...</div>
</td>
The display
is initially set to none but once it is unfolded for the first time, I am setting the height
to 100% and removing the display
style.
You can move it off the screen:
$(elem).css("position", "absolute").css("left", -9999);
Or set it's height to 0:
$(elem).css("height", 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With