Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Commas in textarea value

Posted on 2004-08-18
3
Medium Priority
?
248 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:smurray20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
peh803 earned 500 total points
ID: 11830713
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
 

Author Comment

by:smurray20
ID: 11830781
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
 
LVL 19

Expert Comment

by:peh803
ID: 11830833
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question