File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes reading a form field. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "reading a form field." Watch "reading a form field." New topic

reading a form field.

BalaKishore Pamarti

Joined: Jul 26, 2005
Posts: 5
this might be very trivial...

i am trying to read the values entered in textboxes which are created dynamically in the jsp as say....

<INPUT type="text" name=txtSample<%=count%> >

if count assumes the values 1 thru 10...i am not able to read the values in the textboxes using request object in my servlet...

request.getParameter("txtSample1"); is returning null.

any pointers...

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Once the JSP is sent to the browser, do a View Source and make sure that the HTML is well-formed and what you expect.

Once mistake I can see is that you are not quoting the name attribute. This can cause subtle problems.
[ February 06, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: reading a form field.
It's not a secret anymore!