reset password
Author Message
ytsai8
Posts: 47
Posted 00:05 May 10, 2015 |

Anyone know how to get the boolean value from the checkbox?

tried using getParameterValues like: 

rememberMe = Boolean.parseBoolean(request.getParameterValues("rememberMe")[0]);

but it is not working :(

303496263
Posts: 68
Posted 00:14 May 10, 2015 |

All you need to do for this problem is check to see if the check-box is checked. Do the following

if(request.getParameter("rememberMe") !=null){

//the checkbox has been checked, so go ahead and send the client a chocolate cookie

}

This means that the check-box which has the name "rememberMe" was checked when the form was submitted. If it was not checked, the code above will return null : )

Last edited by 303496263 at 00:16 May 10, 2015.
ytsai8
Posts: 47
Posted 00:39 May 10, 2015 |

Thank you so much :O

303496263
Posts: 68
Posted 01:08 May 10, 2015 |
ytsai8 wrote:

Thank you so much :O

You're very welcome : )