This appears to be a JavaScript issue, or maybe an HTML issue. In a browser, 
looking at the page, Control-click on the element you are trying to read (you 
may need to change it to a text input if it is a hidden element at the moment) 
and choose Inspect Element from the contextual menu. See what the ID of that 
field really is.

The jQuery code you posted should work. Try it old-school with 
console.log(document.getElementById('club_id').value) and see what that gives 
you. If the ID is not exactly club_id, or if there is more than one such 
element in the page, then you may get an instructive error.

Walter

On Nov 23, 2014, at 1:30 PM, Pierre Caserta <li...@ruby-forum.com> wrote:

> $("#club_id").val() in my javascript gives me {:name=>:club_id, 
> :value=>11500}
> 
> how can I get the value 11500?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/cb436bb7eb617a209131b49439ae42e2%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/D3611A55-4A2D-4394-A888-E35DF30B6EBA%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to