Rokit Posted September 27, 2011 Share Posted September 27, 2011 I'm trying to retrieve the text from a text area and put this in a PHP variable without submitting the form. The text is provided by a database and I want to format it for the user. How can I do this with PHP? So basically: <form id="createForm" name="createForm" method="post" action=""> <textarea name="subjectTextArea" id="subjectTextArea" cols="45" rows="5"> This is the text I want to put in a PHP variable before the form is submitted. </textarea> </form> <?php $txtArea = ? ?> Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/247961-read-a-text-area-without-submitting/ Share on other sites More sharing options...
requinix Posted September 27, 2011 Share Posted September 27, 2011 You cannot get anything to PHP without submitting data in one way or another. It doesn't have to be with a form - you can do AJAX, for instance. Quote Link to comment https://forums.phpfreaks.com/topic/247961-read-a-text-area-without-submitting/#findComment-1273276 Share on other sites More sharing options...
litebearer Posted September 27, 2011 Share Posted September 27, 2011 I agree with Requinix; however, the question could be read as how to populate the text area with content from the database ("The text is provided by a database and I want to format it for the user") Quote Link to comment https://forums.phpfreaks.com/topic/247961-read-a-text-area-without-submitting/#findComment-1273286 Share on other sites More sharing options...
Rokit Posted September 27, 2011 Author Share Posted September 27, 2011 I agree with Requinix; however, the question could be read as how to populate the text area with content from the database ("The text is provided by a database and I want to format it for the user") Oh ok, so it has to be submitted. Yeah, I thought of that right after I posted, litebearer. It would probably be better just getting the info straight from the database, then I can just format it and put it into the text area. Thanks anyway guys. Quote Link to comment https://forums.phpfreaks.com/topic/247961-read-a-text-area-without-submitting/#findComment-1273290 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.