The form below demonstrates three things. First of all the action is not this page because the script that processes the form is not on this page. Next, it uses a hidden input a textarea to gather data.
<form action="page_02a.php" method="post">
<input type="hidden" name="came_from" value="http://eclecticdjs.com/mike/tutorials/html/forms/page_02.php">
<textarea cols="40" rows="5" name="ta"></textarea>
<br />
<input type="submit">
</form>
Sometimes, you want to pass data from one page to another but the data isn't something that the user needs to see. A hidden input is one way to pass such data. The example above contains a hidden input named, "came_from" with a value being the URL of this page. When submitted, that data is transmitted to the form's action for processing.
<textarea> is used instead of text input when you want to have your form accept large blocks of text. Webtv users see a big text box, computer users see a big box with a scroll bar. Textarea, like all form elements, has a name attribute to identify it but instead of a value attribute, the value is put inside of the <textarea></textarea> tags. The attribute cols controls the width and the height is controled by the rows attribute. With Webtv, you can also control the width with a width attribute either as a percent of the available space, width="50%", or in pixels, width="300". CSS will work for the size for both Webtv and computers. In addition to the Webtv only attributes, usestyle, autoactivate, nohighlight, nobackground, and border="0", Webtv users can also use the attribute growable to make the textarea grow to fit it's contents.
|
|
|