vivarem logo
/ Vivarem / Computers and IT / IT Education / online / tutorial / Html / chap6 /
There are 0 sub sections

You can add Your Link here with New Link
Forms and more on colors

HTML forms
Form are used for information gathering
Syntax: <form action="" method="" target="" enctype=""></form> The form is a container tag with other elements enclosed in it.
Attributes action the name of the program which will process your form it can even be send to an emailid with emailto:myid@myserver.com. the action can be a relative or absolute address. target dertermines where you should display the result enctype will tell the browser what is the encoduing of the content that is send if you are uploading images/file you have to put multipart/form-data in enctype. otherwise use for form submition there are two methods GET and POST. GET submits the data as url-encoded and POSt submits it as part of request message body.

Basic form elements
<input> The input Tag can act as type button, checkbox, file, hidden, image, password, radio, reset, submit, text etc according to the type attribute specified e.g. <input type= text> means it is text field where as <input type="radio"> means it is a radio button.
text field you can specify maxlength, size attributes, maxlength determine the maximum number of chars that can bentered in a field and size is displayable size of the field. The default value of a text field is given in value attribute. The form processing requires that the field be identified with a name, this name is given in the name attribute. in addition a radio button or cehckbox may have checked attribute to specify the element is checked on time of loading. type=file to upload a file, type=hidden to specify a hidden field that is not visible while displaying the form.
you can disable an iput or any other field by specifying "disabled=disabled" in the tag. Password type will hid the typed text.

Multiline text
to enter multiline text like address you have to use textarea field
Example syntax:<textarea. rows="" cols="" name="">any there \n\r anything here</textarea> dtata between the textarea is the default data.

Selection
A selection can be multiline or dropdown.
Default Syntax:
<select name="">
<option value="x01">google.com </option>
<option value="x02" selected>yahoo.com </option>
<option value="x03">msn.com </option>
<option value="x04">ask.com </option>
</select>
you can have multiple option elements in the select field. the option element will have a value attribute where you specify the value of the description which identifies the description uniquely. the description is enclosed between the option tag. optionally you may add asize attribute to make the dropdon a selection with default no rows to be made visible in the selection box. eg size=10, displays 10 rows
Learn by doing - Form

Specifying color
color is specified as hexadecimal or integer or colorname
specifying color as hexadecimal:#000000 - #ffffff in 3 pairs representing red, green and blue the primar colors from the hash, each color has a value 00 to ff. specifying color as integer values. rgb(0,0,0) to rgb(255,255,255) here color has values between 0-255., the basic colors.
#000000 repersent black while #ffffff represent white

#0000ff - rgb(0,0,255)- blue
#00ff00 - rgb(0,255,0)- green
#ff0000 - rgb(255,0,0)- red

The above as well some of the known color names can be used to apply colors color=white or color=black to identify the specified colors
Apart from the above the html element also have head element which give information about the page in general
Example Syntax: <html><head> <title> Your html page </title></head> <body> <p<hello how are you<p></body></html>

Learn by doing - Form

vivarem learn by doing more advanced html tutorial with online practice


You can Add a Classified here with New Classified