|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hidden Fields In HTMLYet another type of input in html is HIDDEN input. <INPUT TYPE=HIDDEN NAME="FORMNAME" VALUE="Company Position Form 1"> A HIDDEN input is a name/value pair that is returned to you but does not show up anywhere on the web page. The hidden input above is needed for use with Mailto Formatter. Let's suppose you were a company trying to generate leads for a new product. You have a standard form for gathering information... name, company, phone, products interested in, etc. The only problem is there are 6 slightly different versions of the form in 6 slightly different places. You need to know what's coming from where. What to do? You could add a HIDDEN input to your forms like so... <INPUT TYPE=HIDDEN NAME="FORMNAME" VALUE="Version 1"> ...for the first version By the way, it doesn't matter what the name/value pair in the hidden input is (or any input for that matter). I have just been using "FORMNAME" because it saved me some typing. This would be a perfectly legitimate HIDDEN input... <INPUT TYPE=HIDDEN NAME="E" VALUE="Mc^2"> ...You would get back E=Mc^2 HIDDEN inputs are also useful for cgi scripts. For example, many Internet Service Providers have a script you can have your forms sent to. It then spits the form back to you all nice and neat and ready for human consumption. The hidden input tells the cgi script who you are, where to send the parsed data, etc. They really are very simple... <INPUT TYPE=SUBMIT>
SUBMIT of course, sends the data... ...and RESET, clears the form. <INPUT TYPE=RESET>
We can easily change what the buttons say. <INPUT TYPE=SUBMIT VALUE="Send it away Ray!"><BR>
If necessary, the SUBMIT button can also have a NAME. You would need this if, for whatever reason, you had more than one SUBMIT button. Next we must tell the browser where to send the data we gather and how to send it. There are two basic things you can do:
Note- Microsoft's Internet Explorer 3.0 does not support mailto forms. When you try to submit the information, the new mail message window pops up. Explorer does however support forms sent to a CGI script. <FORM METHOD=POST ACTION="mailto:xxx@xxx.xxx" ENCTYPE="application/x-www-form-urlencoded"> Unfortunately the data will be sent to you in this 'only useful to a computer' format... FORMNAME=New+Entrant&NAME=R.U.+Havinfun&ADDRESS=1313+Mockingbird+Lane What you'll need is a program to turn it into 'useful to a human' format... FORMNAME=New Entrant When you put a mailto form on your page and someone sends you information, you'll notice that it is sent with a default Subject. If your visitor was using Netscape you'd get the default Subject "Form posted from Mozilla". Other browsers might send "Form Response", etc. You can change this by editing what's in the <FORM> tag as follows... <FORM METHOD=POST ACTION="mailto:xxx@xxx.xxx?subject=Company feedback form" ENCTYPE="application/x-www-form-urlencoded">
Your own HTML page Open the page "feedback.htm" in Notepad, and add the following (the blue text is what to add). <html> <body realsrc="bgnd.gif" background="http://www.zeronese.net/knowledge-base/admin/bgnd.gif"> <center><h1>Feedback Form</h1></center> <br> <form method=post action="mailto:YOUREMAILADDRESS?subject=Feedback" enctype="text/plain"> <b>My name is: </b><input type=text name="name"> <p> <b>I work as a:</b><br> . . </p> <p> <b>When it comes to web browsers:</b><br> . . </p> <b>I rate your site as:</b><br> . . </p> <p> <b>Comments:</b><br> . . </p> <p> <input type="submit" value="Send it!"><br> <input type="reset" value="Clear it!"> </p> </body> </html> Save the file and test in your browser.
Comments, Questions & Reviews
Comments is currently disabled for this article! Related Articles and Readings
The information provided in this article is for general information and/or the comments is the sole responsibility of their respective authors and does not necessarily reflect the opinion of zeronese.net does not endorse any article and/or comments published by our web users unless otherwise noted. |
Categories
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

