Bookmark Topic Watch Topic
  • New Topic

Two submit buttons for a form  RSS feed

 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,

I need to have two different submit buttons on a form and based on the button clicked, related code needs to be executed.
I read a topic on this and kept the name same for the buttons like this :-
When I execute the code in the servlet, I get the button value as null.
This gives NullPointer exception.
Please advise.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66149
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Have you set a non-default enctype for the form?
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
Apologies again.

I've set it to "enctype="multipart/form-data.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66149
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Then the answer is the same as your other post. You can't use getParameter() with forms that have any other enctype than the default.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!