• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

have problem with multiple forms on a jsp

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have different forms on a single jsp and the code goes like this:



i have jquerey for accordion and tabs..each accordion opens to give a form which refers a servlet at backend..

i get the following error when i try filling a form and submit it:

java.lang.NumberFormatException: For input string: ""
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I actually see only one form on there - as delineated by <form> </form> tags. So you don't have multiple forms. If you want multiple forms, you will need to put each one in their own set of form tags and give each one their own submit button.

The error tells you that you are trying to pull out a value for a field and turn it into a number, but the field was not entered by the user. So you have to validate the form (at least check that all required fields were entered) and respond to the client that there are missing values if they haven't filled the form out completely.
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic