Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/140041-solved-need-a-little-textareaform-help/
Share on other sites

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).

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.