0

I have a simple login which starts off with a disabled login button unless the username and password are filled (this check is done by jQuery and removes the disabled attribute if filled).

The problem I am now having is checking to see if the fields are pre-filled by an existing cookie, if they are, then the pre-emptive disabled attribute should not be applied. I was thinking of doing this through Rails but perhaps it can also be done via Javascript / jQuery.

So the question in short could be: how do I check for a cookie in Rails 3.2.* or jQuery?

1

1 Answer 1

3

In the controller you can just say cookies["key"] to get the value of something stored in a cookie.

Sign up to request clarification or add additional context in comments.

1 Comment

This can also be done using jQuery through a plugin: stackoverflow.com/questions/1599287/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.