a0101 Posted August 10, 2012 Share Posted August 10, 2012 I want to retrieve the input from the textarea from another page. Similar to the purpose of e.g <input type="text" name="subject" value="My text here"> where I can retrieve it from another page by $subject=$_POST['subject']; but I can't use <textarea name="subject">My text here</textarea> or even <textarea name="subject" value="My text here"></textarea>, so how do I do it through html? Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/ Share on other sites More sharing options...
Mahngiel Posted August 10, 2012 Share Posted August 10, 2012 but I can't use <textarea name="subject">My text here</textarea> why not? that is how you create a textarea Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1368426 Share on other sites More sharing options...
BuildMyWeb Posted August 18, 2012 Share Posted August 18, 2012 i dont understand what youre asking. you can capture the data from a textarea just as you would a text input. Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1370544 Share on other sites More sharing options...
jardrake Posted August 19, 2012 Share Posted August 19, 2012 Giving a textarea a name and capturing that name in the same way you did with a textfield is the only way to do it in html, without JavaScript. Maybe you're asking why you can't get the value and not stating that you cannot use a textarea? Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1370722 Share on other sites More sharing options...
hakimserwa Posted August 31, 2012 Share Posted August 31, 2012 make sure you are not forgetting to submit Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1374170 Share on other sites More sharing options...
matthew9090 Posted September 2, 2012 Share Posted September 2, 2012 Try checking that your form has the right submitting method (GET/POST). Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1374699 Share on other sites More sharing options...
DavidAM Posted September 3, 2012 Share Posted September 3, 2012 $0.02 Make sure the TEXTAREA is inside the FORM tags Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1374785 Share on other sites More sharing options...
spiderwell Posted September 6, 2012 Share Posted September 6, 2012 if you are trying to repopulate the textarea, you need to put it inbetween the textarea tags not into a value attribute <textarea name="example"> <?php echo $_POST['example']?> </textarea> Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1375720 Share on other sites More sharing options...
Christian F. Posted September 6, 2012 Share Posted September 6, 2012 You'll need to add htmlspecialchars () around $_POST['example'], to avoid any HTML injection attacks or simply unintentional breakage from the user's input. "<3" might not have any particular meaning as HTML code, but it will have quite a bit of effect on how the rest of the code is parsed. Quote Link to comment https://forums.phpfreaks.com/topic/266895-capturing-input-from-textarea/#findComment-1375874 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.