Simplemde-markdown-editor: How to send data using post form with php?

Created on 14 Nov 2015  路  3Comments  路  Source: sparksuite/simplemde-markdown-editor

Hi there,

How to send data using post form with php?

captura de pantalla 2015-11-13 a la s 21 23 22

Doesn't work :disappointed:

But, using preview mode works

captura de pantalla 2015-11-13 a la s 21 27 46

question

Most helpful comment

I believe this may be something on your end. I am unable to reproduce this error using the code snippets you provided.

Here's the full file I used: test.php

<?php
print_r($_POST);
?>

<form role="form" method="post" action="test.php" name="myForm" id="myForm">
     <textarea class="form-control" rows="3" id="my-post" name="post"></textarea>
     <button class="btn btn-default" type="submit">Send</button>
</form>

<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

<script>
var simplemde = new SimpleMDE({
    element: document.getElementById("my-post")
});
</script>

All 3 comments

Can you post relevant HTML and PHP code? Hard to debug without that.

Hi,

This is my form

<form role="form" method="post" action="test.php" name="myForm" id="myForm">
     <textarea class="form-control" rows="3" id="my-post" name="post"></textarea>
     <button class="btn btn-default" type="submit">Send</button>
</form>
<script>
var simplemde = new SimpleMDE({ 
    element: document.getElementById("my-post") 
});
</script>

Php code, only this:

print_r($_POST);

I believe this may be something on your end. I am unable to reproduce this error using the code snippets you provided.

Here's the full file I used: test.php

<?php
print_r($_POST);
?>

<form role="form" method="post" action="test.php" name="myForm" id="myForm">
     <textarea class="form-control" rows="3" id="my-post" name="post"></textarea>
     <button class="btn btn-default" type="submit">Send</button>
</form>

<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

<script>
var simplemde = new SimpleMDE({
    element: document.getElementById("my-post")
});
</script>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

prologic picture prologic  路  4Comments

libregeek picture libregeek  路  3Comments

elsuxo picture elsuxo  路  3Comments

mbeckenbach picture mbeckenbach  路  4Comments

xJoeyv picture xJoeyv  路  3Comments