hidden fields in HTML forms

Skip Montanaro skip at mojam.com
Mon Aug 2 22:28:45 CEST 1999

    Rick> Could anyone point me in the right direction of finding a cgi
    Rick> class that catches hidden fields sent to it from an HTML form?
    Rick> cgi.py doesn't recognize them;


There's no reason for cgi.py to recognize anything special about hidden
fields.  They are only hidden from the web user, not the cgi script.  To
cgi.py, an input is an input.

If you want to fiddle around with the <INPUT> TYPE attribute and see what
the CGI script sees, set your <FORM>'s ACTION attribute to


That script uses cgi.FormContent() to grok form inputs and spits back
several bits of information about them and the environment in which the
script was executed.  If you give it a hidden input, e.g.:

    <form METHOD=GET ACTION="http://www.musi-cal.com/cgi-bin/query">
	<input TYPE=hidden name="hidden" value="You can't see it but I can!">
	<input TYPE=text name="visible" value="Users see this!">
	<input TYPE=submit>

you'll see what I mean.

Skip Montanaro	| http://www.mojam.com/
skip at mojam.com  | http://www.musi-cal.com/~skip/

More information about the Python-list mailing list