This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes getParameter value of a button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "getParameter value of a button" Watch "getParameter value of a button" New topic
Author

getParameter value of a button

WeiJie Lim
Ranch Hand

Joined: Sep 05, 2012
Posts: 92
The following code activates when a button named "search-btn" is clicked.

However, why does it still work even when I set the value of the button to null ?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

"" is not null. It is the empty string.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
WeiJie Lim
Ranch Hand

Joined: Sep 05, 2012
Posts: 92
Bear Bibeault wrote:"" is not null. It is the empty string.


Oh I see, thanks.

So in fact the code will always activate for buttons right ? Since there isn't a case which the value attribute can be null.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Did you try omitting the value attribute completely?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: getParameter value of a button
 
jQuery in Action, 3rd edition