• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to display the text area in console  RSS feed

 
Sucheta Shrivastava
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am   writing an HTML which is linked to the Servlet. I am able to get the output of the name and city fields in the console . However, i am unable to get the details of the textarea in the console.

HTML program -



Servlet program -



output-
sucheta
mumbai
null


how to get the comment   section in the textarea printed the eclipse console with method = "post"
 
Sucheta Shrivastava
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here the comment section i am getting null. I name and city get shown by the submit button but how to view the comment section
 
Tim Moores
Saloon Keeper
Posts: 4024
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "comment" field is outside of the form tag in the HTML, so it does not get submitted to the server.

The "form = "userform"" attribute does nothing, and you should remove it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, in HTML5 the form attribute should cause the textearea to be included in the form even though it is physically outside the form. I have never done this so I can't vouch for how well it is implemented in the browsers.

In this case, there is clearly no reason why the text area needs to be outside the form, so the simplest fix is to move it to within the form.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!