• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic