I am trying to put a 'Rememeber me'check box in logon page and based on the value of check box I am setting the cookie in the next page. But while doing this I am checking whether the check box checked true or not in the function of checkbox which is called on onChange event. If it is true I am assigning 'yes' value in a hidden field and passing it to another page else I am assigning 'No' value to hidden field. In my case if it's true it's taking yes but if it's not true then it's not taking 'No'. So it's failing there. I tried putting else if too but still it's not working. Please provide a soution to this.
I have tried to get that hidden field value in the next page by using request.getParameter(), getRequestParameter(). These didnt work. So I tried with session variable too. But if I used the session varaible inside the function of checkbox which is called on onChange event. But if I am doing so it's always taking yes value even if I closed that session. Please suggest. Thanks in advance.