what are hidden fields purpose in forms?

im not sure what hidden fields are for when making forms.  why would i use them?    thanx
LVL 1
flashactionsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
erikTsomikSystem Architect, CF programmer Commented:
primarily it used to pass the variable after the form is submitted but the value is not being entered  but the user. It can be passed by DB or be hardcoded
0
gamebitsCommented:
To pass to the next page information you don't want your user to know about (not in a negative way), you may for example query a database with the user login name and get the user id you would then pass the user id to the next page for whatever reason, your user doesn't need to know is userid number.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

flashactionsAuthor Commented:
how can i assign their user id to the hidden field?
0
Cornelia YoderArtistCommented:
It's so you can pass a piece of information from the form script to the action script that is NOT a user input.  It is not normally seen by the user, BUT be aware that it can be seen in the source, so don't use it for anything sensitive or hackable.  Whatever type of anti-hacking/injection protection you are using should be applied to hidden inputs as well as user inputs.
0
Cornelia YoderArtistCommented:
<input name=userid type=hidden value=<? echo $userid; ?> >
0
flashactionsAuthor Commented:
interesting
0
flashactionsAuthor Commented:
thank you all
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.