Commas in textarea value

Hi,

I have a textarea on my page.
The contents of the textarea are provided by an ASP recordset value, However the user can amend the contents.
When i get the value from the textarea (using document.frmThisForm.txtTextArea.value)
I get 4 commas returned after the characters that I have entered.
If I enter nothing I still get the 4 commas returned.

And sometimes the contents of the box are returned as 'undefined'

Why is this happening?
Thanks
Suzanne
smurray20Asked:
Who is Participating?
 
peh803Connect With a Mentor Commented:
can you post the code, please?  It sounds like you might have 4 text areas with the same name on the form....could this be possible?  If this is the case, the values posted on a form post are all delimited by commas...

Anyways, a quick look at the code should help to clear things up..

regards,
peh803
0
 
smurray20Author Commented:
You're right!
That was driving me crazy!

Ive got a bit of a tricky situation though -
Users can have up to 4 items (each item consists of 3 textareas) - ive just used a loop around one row of a table for each item.
They can create blank items and then complete them in their own time.
They select a number between 1 and 4 from a dropdown but there is the option to add another item afterwards.

Ive been using onChange to set a variable to know if the textarea has been changed.
But i'm not sure that since i have up to possibly 12 textareas - how will i know which ones to update?
and how will i control the updating?

I know this isnt the original post but if you have any ideas I'd be very greatful!
Thanks
Suzanne
0
 
peh803Commented:
Why not just update each text area each time?  That way, you don't have to keep track of which ones have changed and which ones haven't, you don't have to write any complex code to interpret your flags, etc.  The database hit to update 12 items instead of 9 is relatively small, as long as you do it all within the same opened connection..  Obviously, you probably have good reasons to not want to update EVERY one EVERY time, so if you want to stick to this, let me know and I can help you come up with something (separate question / points, perhaps?)

Thanks,
peh803
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.