Hidden field in HTML

Hidden field in HTML
 
Hidden field in HTML
  • Currently 0 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0/5 (0 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


Hidden field is not displayed on the page and its content is hidden from the user. Visitor of the site can not insert or input anything into it. The purpose of creating the hidden field is to transfer technical information to the server. In most cases, it is used to send form data from page to page.

The syntax for creating a hidden field as follows.

<input type="hidden" name=... value=...>
  • name - the name of the field, which allows the program to identify it.
  • value - the value of the field determines what information will be sent to the server.

How to use a hidden field is shown in example 1.

Example 1. Creating a hidden field.

<form method="post" action="/cgi-bin/handler.cgi">
  <b>Your favorite word (no data will be passed to the server!):</b><br>
  <input type="text" size="25">
  <input type="hidden" name="UserName" value="Ronny">
  <input type="hidden" name="password" value="pupkin"><br>
  <input type="submit">
</form>

The result is shown below.

Your favorite word (no data will be passed to the server!):

In the example the hidden fields are not displayed on the web page, but when the form is sent to the server, hidden fields are passed along with it.


 

Read also

Adding a form to a page in HTML

Adding a form to a page in HTML

Text field in HTML

Text field in HTML

Buttons in HTML

Buttons in HTML

Form elements in HTML

Form elements in HTML

Post comment

basicuse.net
html5_css
106160485398655174790

Quick navigation

General navigation