Solved

Commas in textarea value

Posted on 2004-08-18
3
244 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
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
peh803 earned 125 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
JavaScript Loan Calculator Error 3 34
dynamic created check uncheck boxes 6 41
Can't get javascript video player button to work 10 23
Can't get js code to execute 8 29
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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.
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…

679 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