I have a form with multiple divs that are not visible (Toggle jQuery) because of user interaction. After submitting the form I would like to save only the visible (filled by user) elements. Can't get it to work. Thanks in advance!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$('#content').text($('#myform').serialize());
});
});
</script>
</head>
<body>
<form action="" id="myform">
First name: <input type="text" name="FirstName" value="Mickey"><br>
Last name: <input type="text" name="LastName" value="Mouse"><br>
<div style="display:none;"><input type="text" name="isthishidden" value="maybe"></div>
<input type="hidden" name="action" value="verwerk">
</form>
<button>Serialize form values</button>
<p></p>
<div id="content"></div>
</body>
</html>