zip_000 Posted January 8, 2009 Share Posted January 8, 2009 Hello, I'm having trouble with a textarea - I just don't see how to get accomplished what I want to happen. Here's an explanation: I have a form with information in it that is written to and read from a MySQL database. Different users have different levels of access, but everyone has access to make notes in a textarea field. What I want is for whenever there is anything typed into the textarea for the users' login name to be automatically input beside the note...i.e. the user types in "Random Note" and what gets written to the database and returned to them is "Random note --zip_000" What I'm getting instead is "--zip_000" whenever anything is submitted - whether the textarea has new text or not. So if I submit a few times, I get "Random Note --zip_000 --zip_000 --zip_000" I can see clearly why it isn't working, but I just can't see how to make it work. Any suggestions? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/140041-solved-need-a-little-textareaform-help/ Share on other sites More sharing options...
zip_000 Posted January 8, 2009 Author Share Posted January 8, 2009 I've got part of it figured out, but I'm still having a couple of problems. I realized that I could carry the textarea value back to the beginning of the form by putting it in a variable and putting the variable into a hidden input. With the original value of the textarea at the beginning of the form, I can compare it against the new value of the textarea and if it is different append the username at the end of the note. The problem I'm still having: The first time through the form - regardless of what the user does, it always appends the username in the textarea - even if the user hasn't changed anything in the textarea. (After posting this I realized that the problem I'm having has little to do with MySQL. I am reading from the database, but that isn't where my problem is...but I didn't want to double post this into the proper forum). Quote Link to comment https://forums.phpfreaks.com/topic/140041-solved-need-a-little-textareaform-help/#findComment-732780 Share on other sites More sharing options...
zip_000 Posted January 8, 2009 Author Share Posted January 8, 2009 Sorry to reply to my own message - twice at that - but I've got the problem fixed. What is it about asking for help that lets you see where you went wrong in the first place even before help arrives? Quote Link to comment https://forums.phpfreaks.com/topic/140041-solved-need-a-little-textareaform-help/#findComment-732817 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.