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
6
votes
1 answer

Setting hidden field value with Jquery $('#id').attr("value", 'val'); not working in IE

I noticed that IE doesnt fill the value of a hidden field, using the code below, while Chrome and FF have no problem with this. $('#id').attr("value", 'val'); I tried a few other things like .setAttribute or .val() = "val";
TrustMe
  • 95
  • 1
  • 2
  • 7
6
votes
4 answers

change field value when select radio buttons

I want to change the value of hidden input field when radio buttons selected : 10
45
datisdesign
  • 3,165
  • 8
  • 30
  • 29
6
votes
3 answers

Count the number of options in a list

I'm trying to count the number of options in a list. However, some of the options have been hidden due to the search text entered into an input box. I started off looking into .size() and .length but was only getting the full list rather than those…
David
  • 320
  • 1
  • 6
  • 22
5
votes
2 answers

What are Oracle hidden fields?

ALL_TAB_COLS differs from ALL_TAB_COLUMNS in that hidden columns are not filtered out. What are hidden fields? This view differs from "ALL_TAB_COLUMNS" in that hidden columns are not filtered out.
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
5
votes
1 answer

MVC @Html.HiddenFor renders html form with no value

Caution, before You read the rest This question is not about POST method, redisplaying view with submited form or binding input values to controller method parameters. It's purely about rendering the View using html helper (HiddenFor or Hidden -…
Przemysław
  • 206
  • 1
  • 7
5
votes
5 answers

Large viewstate in HTML source

This is 10KB in my HTML source:
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
5
votes
2 answers

How to gracefully die?

So I've just read Why to never use 'or die'. I am more confused then ever. I am validating a complicated form and I go though many nested levels of if statements and what not and I am passing a variable to the form which is called $status which can…
Mallow
  • 844
  • 1
  • 13
  • 37
5
votes
2 answers

Passing a List as @Html.Hidden and the list is being deleted

I am having an issue sending through a list from a form to a controller to work with and edit. It just destroys the list and passes through just one empty string. I need the list to maintain so that i can add to it in the controller. The view looks…
rubidge96
  • 109
  • 2
  • 12
5
votes
4 answers

Store JSON in a hidden input element?

I need to be able to generate an effectively unlimited number of datasets, so what I want to do is something like this; I tried JSON.stringify to convert my array in javascript…
Stephen Belanger
  • 6,251
  • 11
  • 45
  • 49
5
votes
4 answers

knockoutjs data bind hidden field value

I'm having a hidden field in a knockout template that its value gets updated with jquery. The problem is when trying to pass this value to the server with ajax, I get null value in the controller. But the html source code shows that the value of the…
Wedad Shurrab
  • 95
  • 1
  • 1
  • 7
5
votes
1 answer

The model's Hidden bool field remains False after it was set True in the controller

I have this property in my ViewModel class: public bool AreSimilarEntitiesChecked { get; set; } In my controller I set its value 'true' and return the View with the model: model.AreSimilarEntitiesChecked = true; return…
5
votes
6 answers

How to detect hidden field tampering?

On a form of my web app, I've got a hidden field that I need to protect from tampering for security reasons. I'm trying to come up with a solution whereby I can detect if the value of the hidden field has been changed, and react appropriately (i.e.…
Myron Marston
  • 21,452
  • 5
  • 64
  • 63
5
votes
2 answers

how to pass data in an hidden field from one jsp page to another?

I have some data in an hidden field on a jsp page how to access or pass this field onsubmit to another page?
patz
  • 1,306
  • 4
  • 25
  • 42
5
votes
1 answer

Targeting hidden inputs by id using jQuery

For some reason I am unable to retrieve hidden inputs by id using jQuery. I can do > $('input') [​, ​,
Elise
  • 5,086
  • 4
  • 36
  • 51
4
votes
2 answers

Need help passing the value of a jQuery UI Slider to a form using the hidden_field in Ruby on Rails

I'm new to Rails so sorry for the extremely basic question. I'm trying to store the value of a jQuery UI Slider in my database when a form is submitted. For other elements such as a text_area this can be done by <%= f.text_area :my_score %> or for…
diasks2
  • 2,033
  • 2
  • 36
  • 61