I have a contact form that displays the error in a div with the class .error.. it has "margin-bottom:2em;" which pushes the contact form down since its above the contact form. How do I activate the "margin-bottom:2em" only when the error div is displaying errors?
You would need to add the margin to it's own class and then when the error is triggered (assuming you're doing this with javascript) you could change the class of the div to the one with the margin. When the error has been corrected you could trigger the class to switch back without the margin.
How are you hiding the error div before it's shown? It should be as easy as div.error display none. The script (depending) should handle the rest. Here is some code to look at... http://www.visibilityinherit.com/cod...ation-demo.php
Bookmarks