I have a schedule with a textarea, I send this schedule to a sql database (all fine), after I can see the registers retrieving these from the database (a html list or table). All this process work fine but... now I want to edit the textarea value in my html table or list, therefore I changed
The System.out is only because I wanted to see what are happenning.
When I execute the query this retrieve the values fine in the textarea elements the first time but when I press the Submit button I want update the database with the new textarea values.
The problem is : when I generate the list again the textarea values are wrong or displaced, is to say, when I check the system.out in the tomcat the values from the textareas are very down for example:
here the values
This seem that the getParameterValues request every row of the textareas as a simple variable.
I am using something as:
Ok, I hope you understand my problem. I can not to post all the code because is too long for to post in a forum!
Si Señor, I need and want update me! but I will do that when I finish this project (I am too advanced in it). Also I am using MVC but I am generating html pages with servlets and using Scriplets in my few JSP pages, all that is wrong in this times!
I will update my knowledges I promise
Thanks for the link I will read all this tomorrow because now is time for sleep here.
kunal porwal wrote:To get value from text area you will need to use multipart html form.
That is completely incorrect!
A multi-part form is only necessary for file uploads.
Joined: May 13, 2010
All that extra gunk on your page is what is causing the extraneous whitespace to appear.
You might find this article helpful regarding how whitespace is handled in a JSP.
Hi Bear, I read the article and analyzed it. Now I see with other eyes the JSP pages I will take more care in how to show the information in the near future and to use these more.
You have a very good methodology for to tell complicated things. Congratulations for that
I had resolved the problem, only I change the out.println by out.write in the part affected
I forget that println is with line-feed, I suppose out.print will work fine also. The "\r\n" is not my case because I am generating the servlet manually.
Now I am having a small problem with getParameterValues function and my algoritm. Before I will explain how is my data table showed:
| value1 | value2 | TextArea | CheckBox |
Then when I check any checkbox and press submit it call other servlet and read the parameters :
The problem is that getParameterValues readthe checkbox checked (that is fine) but read all the textareas input (empty or not). Therefore I have 2 arrays diferents length.
| values | textarea1 | checkbox1 |
| values | textarea2 | checkbox2 |
| values | textarea3 | checkbox3 |
If check the checkboxes 1 and 3 and change the text in the textareas 1 and 3 respectively then when I execute the update it textareas values appear in the wrong place, is to say, textarea3 value will appear in textarea2.
I trying to relation both elements (checkbox and textarea). I can not to use the value property in the textarea for obvious reasons, also I can not to use the ID because getParameterValues not use it, then What I can to do?