1
I have a div with the attribute contenteditable="true"
, which opens the text box so that we can write directly in the div, right, so far so good, just like, I wanted to use this div as an input in a form, I didn’t want to use the same input you know, but div doing this function, only it turns out that I can’t get the value of this div with the php post method.
<form action="post.php" method="post" enctype="multipart/form-data">
<div contenteditable="true"></div>
<input type="submit" />
</form>
I know I could do this with Jquery or JS, but I just wanted to know if I could do it directly with php, if anyone knows please. But if I don’t have how I’m going to do it with Jquery... Vllw
Face because you don’t do it using a
<textarea>
and not a div? Why do you need so much to be a div?– hugocsl
Why do I need the element to grow along with the text while it is typing, like facebook, when a publication is being made and is typing it grows, and with textarea appears the scroll bar, And I couldn’t get it to grow with jquery because I still don’t really understand about jquery’s height functions. Already with the div when it goes being typed it already grows along.
– Breno Castro
With textarea you can get this same behavior using
overflow-y: scroll; overflow-x: hidden;
and manipulating the element with js so that when it reaches all the visualisable content, it increases the size, here an example– MarceloBoni