Transform div's into input and validate them in a form

2

I have a div with the attribute contenteditable="true" , which opens the text box in order to write directly on the div, right, so far so good, just what kind, I wanted to use this div as an input a form, I did not want use the input even know, but the div doing this function, it just happens that I can not get the value of this div to post the php method.

<form action="post.php" method="post" enctype="multipart/form-data">
     <div contenteditable="true"></div>
     <input type="submit" />
</form>

I know it would to do this with jQuery or JS, but just wondering if it would like to do directly with php, if anyone knows please. But if you do not have what I'm going to do with Jquery anyway ... Vllw

    
asked by anonymous 20.07.2018 / 15:17

1 answer

4

How to answered by @Andrew Jackman in another question.

  

Only form elements are posted back to the server.

Only form elements are sent to the server. That way, the best way for you to do what you want is to create a input of type hidden and through javascript when doing submit , get the text of the div and go to the created input .

    
20.07.2018 / 16:22