My form is divided into 3 sections, with the latter two initially hidden using CSS. When users click the next button in the first section, the second section is supposed to slide down into view. However, I'm experiencing an issue where the animation starts but then resets immediately. Can anyone help me troubleshoot this problem?
Jquery script:
<script>
$(document).ready(function(){
$("#buttonToSecondaryDetailsSection").click(function(){
$("#secondaryDetailsForm").slideDown("slow");
});
$("#buttonToCommentsSection").click(function(){
$("#commentsDetailsForm").slideDown("slow");
});
});
</script>
CSS in question:
#secondaryDetailsForm, #commentsDetailsForm {
display: none;
}
Edit: I've previously tried using .show() instead of slideDown() but the section just flashed before disappearing again.
Edit 2: Adding e.preventDefault(); solved the issue. Apologies for the messy question as I attempted to create a working example on jsfiddle but encountered numerous errors.