I have this form which is displayed none on page load. And upon clicking an “edit” link, the div container will slide down revealing the form fields which users can edit and update.
Ok this all works fine up until a user makes a mistake on the form and they click update. The page will reload with the errors under each form fields but the div container is display none still so they have to click on edit profile again to slide the container down to see the error. So how do I get around that? How do I make it stay open on the next reload if there is an error?
jQuery("#edit-profile").click(function() {
jQuery("#profile-form").slideToggle();
});
check whether error div is not empty.If so display the profile form