I have a problem in my Rails Project. It runs on Rails 2 by the way.
<%= form.hidden_field :foo %>
Is it possible to get the value of this hidden field with jQuery?
Maybe something like this:
var foo = jQuery('hidden_field').val();
Any Ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would use the ‘:hidden’ selector in jQuery ( http://api.jquery.com/hidden-selector/ ). To expand on @Koraktor’s examples:
or