hidden_field_tag(name, value = nil, options = {}) public

Creates a hidden field.

Takes the same options as text_field_tag

Show source
Register or log in to add new notes.
December 8, 2011
1 thank

hidden field can be changed by JS

Plumba, it’s not that useless if you think about possibility to change a hidden field with JS

February 7, 2011
0 thanks

onchange attribute on a hidden field is useless

In the third example there is no sense to set onchange event since it will never happen…

January 16, 2014
0 thanks

Storing array values

I tried to add a array value using hidden_field_tag and access it in jquery. It just returns the flattened version of array. eg:(If i try to store [1,[1,2,3]] in hidden_field_tag , in jquery iam just getting ‘1 1 2 3’) but if i use input field with type=hidden iam getting the correct value. Why is that?