Questions tagged [hidden-field]

An HTML Input element that users do not see or interact with. It can hold a value and is often used to store client-side variables.

As defined from w3.org:

An INPUT element with `TYPE=HIDDEN' represents a hidden field. The user does not interact with this field; instead, the VALUE attribute specifies the value of the field. The NAME and VALUE attributes are required.

For example:

<input type=hidden name=context value="l2k3j4l2k3j4l2k3j4lk23">

This element is available in the following versions of HTML:

  • HTML 3.2
  • HTML 4.0
  • HTML 5
  • XHTML 1.0

It is important to note that users are able to see the hidden values if they view the source of the page. Hidden fields should never be used to store sensitive information like passwords or credit card information. A good programming guideline is to only use the hidden field to store information that the page has generated or information the user would not know or understand.

946 questions
34
votes
1 answer

Rails - Update a single attribute : link with custom action or form with hidden fields?

Let's say I have a User model, with a facebook_uid field corresponding to the user's facebook id. I want to allow the user to unlink his facebook account. Do do so, I need to set this attribute to nil. I currently see 2 ways of doing this First way…
MrRuru
  • 1,932
  • 2
  • 20
  • 24
31
votes
1 answer

Passing multiple values with hidden input fields

With a select tag, it is possible to post multiple values using only HTML by selecting more than one option? For example: Is it possible to pass…
David
  • 311
  • 1
  • 3
  • 3
31
votes
6 answers

Jquery Hidden Field

Why can't I get the value of this hidden field? I have a control... Which renders as...
Dooie
  • 1,649
  • 7
  • 30
  • 47
25
votes
5 answers

Is it bad practice to use hidden fields?

A fellow programmer told me it was 'bad practice' to use hidden fields in my HTML code. Essentially I have a unordered list that a user selects an item based on a category they selected (the categories are pictures). It then calls javascript to set…
ios85
  • 2,104
  • 7
  • 37
  • 55
24
votes
5 answers

Selenium Webdriver - click on hidden elements

I am trying to automate upload file functionality in Google Drive. The element used to pass parameters is hidden with height - 0px. None of the user actions would make this element visible. So I need a work around to click on the element while it is…
praneel
  • 1,842
  • 4
  • 19
  • 24
23
votes
2 answers

asp.net hidden field not retaining value when updated from code behind

I'm using a hidden field to store a value in an asp.net page. Basically I set the value of the hidden field whenever a value on the form is changed i.e. first name, date etc. The field is on a webform that has a master page and is in the content…
Ciarán Bruen
  • 5,221
  • 13
  • 59
  • 69
23
votes
3 answers

How to type some text in hidden field in Selenium WebDriver using Java

I am using WebDriver with Java for test automation. I have the following HTML code for input field which is hidden: How to type something in hidden field in Selenium2 (WebDriver)? I have written…
user1554024
22
votes
2 answers

rails - what exactly does hidden_field and hidden_field_tag do?

I read through the techy definition of hidden_fields, but am not sure what it really does. My understanding is that it allows you to pass in an attribute for certain parameters. For example, if you have a rich join model, you can use the…
noob
  • 1,807
  • 2
  • 18
  • 34
22
votes
6 answers

Get Value of Hidden Field in Client Side

On a button click on my server side, I assign value to the Hidden Field from a column in my table. Dim dsGetEnquiryDetails = dbl.usp_GetEnquiryRegisterDetails(Val(lblEnquiryRegisterID.Text)).AsQueryable For Each record In dsGetEnquiryDetails …
MusicLovingIndianGirl
  • 5,909
  • 9
  • 34
  • 65
19
votes
3 answers

Set the Value of a Hidden field using JQuery

I want to set the value of a hidden field, using JQuery. Hidden Field: My JQuery: $("#input[name=chag_sort]").val(sort2); What am I doing wrong? I should also mention in console that sort2…
JZ.
  • 21,147
  • 32
  • 115
  • 192
19
votes
7 answers

NVD3 Charts not rendering correctly in hidden tab

I am building a page which contains many charts, which are displayed one at a time depending on which tab you are looking at. The chart in the initially active tab renders correctly. However when I click to another tab, the chart is not rendered…
metaColin
  • 1,973
  • 2
  • 22
  • 37
18
votes
2 answers

Firefox caches hidden inputs

I have a hidden input field in my form. I noticed that if that field's value is changed by javascript, and then the user refreshes the page, that same value will be set when the page reloads. From what I've seen, this only happens in Firefox. I've…
tamir
  • 3,207
  • 2
  • 33
  • 51
18
votes
4 answers

storing an array of strings in a HiddenField asp.net

I need to store an array of string in a HiddenField in my webform with asp.net. Can anybody please tell me how I can achieve that? Thanks
user1438482
  • 389
  • 2
  • 4
  • 12
17
votes
7 answers

Passing hash as values in hidden_field_tag

I am trying to pass some filters in my params through a form like so: hidden_field_tag "filters", params[:filters] For some reason the params get changed in the next page. For example, if params[:filters] used to…
funkymunky
  • 1,811
  • 3
  • 20
  • 22
16
votes
6 answers

What does the __VIEWSTATE hold?

I'm sorry for maybe making such a basic question but in ASP.NET websites what does the __VIEWSTATE input field represent? Also, is there any way to compute it's value (based on the values of other form fields)? EDIT I understand that __VIEWSTATE, as…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
1
2
3
63 64