>cgi = CGI.new
>cgi.params
>
>gives me a hash of all form fields. How can I identify the type ( like
>Hidden )
>of the fields?

I don't believe there is any way for cgi.rb to know the type of those
fields, because the HTTP protocol doesn't, as far as I know, provide
any information about them.

For example, if you have a CGI script that expects two fields "a" and
"b" to be returned, you can pass those parameters to it from the
browser's URL line, using something like

   http://some.place.somewhere/script?a=123&b=xyz

Now, in that case "a" and "b" didn't even COME from a field in a form.

Depending on whether you specify POSt or GET as the method for the
form, the variables come back in one of two ways: as an environment
variable, encoded as per the URL above; or as standard input to the
script, with "a=123" and "b=xyz" on two separate lines.

What's more, generally I don't think you want to write your code such
that it cares where they came from.  If you (could) do that, it would
mean that you couldn't write HTML with embedded Javascript to invoke
your CGI script with specific values if you needed to, which is often
useful.

At least, I've used that kind of facility many times, but then I'm
weird :-).