I have this code: <p class = "foo">Text</p>
And I also have a form: <form action = "XXX.php" method = post></form>
However, how can I get the value of the <p> when I submit it, as the <p> element can be changed.
So what I mean is to be able to post the value of the <p> when the user submits the form, and to be able to access it from that php file with: $_POST['foo'];
Thanks, I have tried to be as clear as possible.
I think your best bet is to make it an input with readonly enabled, and style to to look like a
<p>. It’s better then trying to add it to the POST parameters with JavaScript.Here’s a quick example. I bet it could still be improved with a few extra CSS quirks, experiment a bit.