Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sturts and checkbox

Status
Not open for further replies.

ukindian2001

Programmer
Joined
Jan 13, 2004
Messages
5
Location
GB
hi,
i have a single checkbox in my form..i want to handle it in my action..how do i find the checkbox is checked or unchecked inside the action..i been stuck for more than a day..pls help guys

cheers
 
If the variable is present then its checked, if its not present its not

Code:
<html:checkbox property="someprop" value="true">Yes</html:checkbox>

Then in your action

Code:
if(request.getParameter("someprop")!=null){
  // Its checked
} else {
  // Its not checked
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top