simpson_121919 Posted December 27, 2013 Share Posted December 27, 2013 I have a web application that has about 700 rows, each rows has a html textarea for the user to add personal notes. I would like to pass text of some sort along with what the user typed typed into the textarea box. I want it to be hidden from the user. Any ideas? Any help would be appreciated, I've been stuck on this one for awhile. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/284938-need-to-pass-additional-text-with-_post-var-via-html-textarea/ Share on other sites More sharing options...
Solution kicken Posted December 28, 2013 Solution Share Posted December 28, 2013 Just stick a hidden input along with the textarea and have some method of associating the two, such as the database row's ID number. <textarea name="textarea[<?php echo $databaseId; ?>]"></textarea> <input type="hidden" name="hidden[<?php echo $databaseId; ?>]" value="whatever you want"> When the user submits you'll have two arrays as input, one containing the textarea content and one containing the hidden input's content. The arrays can be matched up with the database row's ID number. Quote Link to comment https://forums.phpfreaks.com/topic/284938-need-to-pass-additional-text-with-_post-var-via-html-textarea/#findComment-1463155 Share on other sites More sharing options...
simpson_121919 Posted December 28, 2013 Author Share Posted December 28, 2013 Thank you very much, that solved my problem. I never thought to "textarea[<?php echo $databaseId; ?>]" This makes my textarea identifiable because I know where in the array it will be stored. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/284938-need-to-pass-additional-text-with-_post-var-via-html-textarea/#findComment-1463171 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.