I’m about to post/upload image(s) using dropzone.js and post some other text form. Here’s my code:
<div class="post-new">
<div class="post-newmeta">
<form method="post" class="dropzone" action="<?= base_url() ?>posts/create" id="my-dropzone">
<div class="fallback">
<input name="userfile" type="file" />
</div>
</form>
</div>
<form id="text-form" class="c-form" action="<?= base_url() ?>posts/create" method="post">
<textarea name="content" id="emojionearea1" placeholder="What's On Your Mind?"></textarea>
<input type="text" name="youtube" id="yt" class="margin-top-10" placeholder="https://www.youtube.com/watch?v=vgvsuiFlA-Y&t=56s">
<button type="submit" name="submit" value="Submit" class="main-btn" id="submit-all">Publish</button>
</form>
</div>
From the code above, I have 2 forms (one for dropzone, one for text-form). But I want both forms to be posted in one click using button.
Please help.