Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

remember me check box not working

 
Shubha Krishna
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody!

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.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it's failing there. I tried putting else if too but still it's not working. Please provide a soution to this.


did you mean javascript is not assigning the value in hidden field?

I have tried to get that hidden field value in the next page by using request.getParameter(), getRequestParameter(). These didnt work.




mean you have to provide hidden field name in the argument of getParameter Method in order to get the value.

try this code in your next page where you passing the request.

your hidden field name = "myhiddenfield"



make sure you hidden field is under the form tag.

hope it helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic