I have two forms that submit content from TinyMCE Inline using the jQuery Form Plugin. These both work fine but I want the ability to submit all of the forms using one button in this scenario. There won't be any more than 5 forms on each page.
I've looked at lots of other posts and none of them seem to work for my situation. Most of the other solutions submit the forms with empty POST values.
<?php require_once('connect.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Tiny MCE</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>
<script type="text/javascript" src="jquery.form.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: '.editable',
inline: true
});
</script>
<!-- Submits forms -->
<script type="text/javascript">
$(document).ready( function(){
$('.input_form').ajaxForm({ url: 'qry.php', type: 'post' });
});
</script>
<script type="text/javascript"> <!-- Loads whatever was submitted last time into the respective div -->
$(document).ready( function(){
$('#index_s1').load('load.php?form_ID=index_s1');
$('#index_s2').load('load.php?form_ID=index_s2');
});
</script>
</head>
<body>
<section>
<h1>Tiny MCE Tests</h1>
</section>
<section>
<button id="submit_all">Submit All</button> <!-- submit all forms using this button -->
<form class="input_form">
<div class="editable" id="index_s1"></div>
<input type="submit" name="sub" value="Submit">
</form>
<form class="input_form">
<div class="editable" id="index_s2"></div>
<input type="submit" name="sub" value="Submit">
</form>
</section>
</body>
</html>
I'm a novice at jQuery which is why I'm using the form plugin.
Thanks in advance!