• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

enum.hasMoreElements()

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
enum.hasMoreElements() returns false when the calling Html page has only one radio button element and user doesn't chose any value.

for eg:

for the above snippet the hasMoreElements() return false.

why and how to overcome this problem
[ September 20, 2005: Message edited by: Parameswaran Thangavel ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't request.getParameter("cardtype") the way to get the value ?
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that is how radio buttons work. Unless you select one, the browser won't send the request parameter.
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi chilkuri
can i say, we can't Come to know whether the user has selected the radio button or not by using the Request.getParameterNames();
is there any way to identify whether the user has selected or not by using the getParameterNames() in the servlet.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Parameswaran Thangavel:
hi chilkuri
can i say, we can't Come to know whether the user has selected the radio button or not by using the Request.getParameterNames();
is there any way to identify whether the user has selected or not by using the getParameterNames() in the servlet.


You could use one more hidden field indicating whether the radio button was selected or not.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic