Questions tagged [hidden-fields]
21 questions
206
votes
18 answers
Set value of hidden field in a form using jQuery's ".val()" doesn't work
I've been trying to set the value of a hidden field in a form using jQuery, but without success.
Here is a sample code that explains the problem. If I keep the input type to "text", it works without any trouble. But, changing the input type to…

texens
- 3,717
- 5
- 23
- 23
136
votes
4 answers
ASP.Net MVC Html.HiddenFor with wrong value
I'm using MVC 3 in my project, and I'm seeing a very strange behavior.
I'm trying to create a hidden field for a particular value on my Model, the problem is that for some reason the value set on the field does not correspond to the value in the…

willvv
- 8,439
- 16
- 66
- 101
18
votes
10 answers
Web security, are there issues with hidden fields (no sensitive data)?
I was having a discussion with coworkers. We have to implement some security standards. We know not to store 'sensitive, addresses, date of birth' information in hidden fields but is it OK to use hidden fields for your application, in general.
For…

Berlin Brown
- 11,504
- 37
- 135
- 203
17
votes
8 answers
Why are hidden fields used?
I have always seen a lot of hidden fields used in web applications. I have worked with code which is written to use a lot of hidden fields and the data values from the visible fields sent back and forth to them. Though I fail to understand why the…

pavanred
- 12,717
- 14
- 53
- 59
16
votes
3 answers
Chrome doesn't cache hidden form field values for use in browser history
I have a ASP.Net web form that contains both text box fields and hidden fields. The hidden field values are modified dynamically using client side JavaScript. Posting the form, inspecting the values and redirecting to another page is all working as…

Andy McCluggage
- 37,618
- 18
- 59
- 69
11
votes
4 answers
Passing an array through a hidden_field_tag in Rails
I did find this question on SO, but it didn't help, really.
So, I'd like to pass an array through a hidden field tag.
As of now my code is:
<%= hidden_field_tag "article_ids", @articles.map(&:id) %>
This obviously does not work since it passes…

Shreyas
- 8,737
- 7
- 44
- 56
5
votes
2 answers
jquery validator - Validating visible elements only
I have a radiobutton that hides/shows a div. All visible elements are "required", but adding ignore: ":hidden" after the validation rules, doesn't work...
Here's the code: