I'm trying to save the content from my TinyMCE text area upon submission of my form.
The body of my page has the textarea and when I hit save, there is a modal pop up with a small form of extra data to submit. When I submit though, it says the index'fulltext'
is undefined. I have this assigned to the post of the name fullText
which is assigned to my textarea but the problem is I'm not actually posting that form.
My text area is higher on the page:
<form id="form-data3" method="post">
<textarea name="fullText" id="mytextarea3"></textarea>
<input type="submit" value="Save Page" style="float:right;" data-toggle="modal" data-target="#savePageModal">
</form>
So I fill that out and I hit a save button that prompts my modal with a form that asks for a few values before submitting. Once filled out, I hit submit which triggers addPage.php but my debugging gives me the undefined indexfor 'fullText'
coming from this first line:
$content = $_POST['fullText'];
$addContent = "
INSERT INTO content(content)
VALUES('$content');
";
Obviously the issue is that my text area is in a separate form from the one posting, but even if I remove the form tags from my textarea, how can I pass that tinyMCE content of the textarea so that when I submit the form in the modal, it submits this text content as well
UPDATE:
2nd form:
<form action="addPage.php" method="post">
<input type="hidden" value="/from previous textarea">
</form>