Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What is this hidden element about in forms?

Featured Replies

Dear experts,

 

I'm trying to make my email interface workable and got to see this form designed by another company.

 

There's this hidden element there..whereby the type they put hidden.

 

What is this hidden function about?

 

Do I need to add in this hidden field in my database when I design with a hidden type ?

 

Hope to hear your advice. thanks.

Its possibly to stop spambots, a spambot will see it as another field to fill in and when the form is submitted it will be rejected by the processing script as the hidden field has content.

also known as a web form honey-trap I believe :)

 

Basically you have a hidden field, call it something like emailaddress (or something a bot will feel it NEEDS to fill in) and then tell the script that if that field is populated, then fail.

 

Quite a simple way of doing things really, but I prefer a captcha myself :)

Hidden fields in forms are usually used for session tokens to prevent CSRF attacks, but can also be used to attach information to a form submission that you might not really need the user to see.

 

For example, I have a "Request a Quote" form on a website that sends a email to the site owner with details about the user. It has a hidden field that is automatically filled in php with the Offer the user was looking at before they click on the link. The user doesn't really need to see this information, she knows what offer she was just looking at, but the site owner does so he can create a quote for that offer.

 

To explain the CSRF attacks, if, say a bank website has some form which posts to transfer-cash.php, If on my site i can use some evil stuff to POST to that script with cashTo=my_account ammountCash=99999, because the POST is running on the users' side it'll send his cookies with it, and if he's already authenticated with the bank then the request will go through and I've just stole his money. To protect against these attacks if you add a hidden session token every time you present a form, then require this matching token be provided before you process the form, then it help mitigate some of this.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.