- Edited
Hello,
I have a very long form that is having problems submitting. The user has several options in a dropdown. Depending on their selection certain chunks of HTML are removed from sight using ".hide()". This all works as expected. The problem is the form will NOT submit if these chunks of HTML code are hidden. If I go to the browser tools and delete each of these hidden HTML chunks the form submits perfectly. I have tried to use ".remove()" but the problem is I am unable to restore it if the user decides to go back and change a form option. I also tried ".detach()" but it does not work if the append function is in another place on the page. I thought that maybe I needed to disable the inputs in these corresponding chunks of HTML. However, that does not make a difference. I also tried to condense the entire chunk of HTML block into a single line (horrible wasteful excess and duplication) and load as "innerHTML". However, there are "<?php echo ?>" elements inside the blocks that do not cooperate in this condensed single line of HTML. Does anybody know how to get the form to submit while there are hidden blocks of HTML code or another way to get this to work?
$('.group2,.group3,.group5').hide();