form element in HTML--Part1

how the forms work in the browse


1. The browse loads the page

the browser load the HTML page like it always does, when it encounters form elements, it creates controls on the page that allow you to input various kinds of data. 

A control is something like a button, input box, or a drop-down menu.

2. You enter data in the contrls

3. submit the form, send the data off to the server

4. the server responds.


2. example

<form action="http://wickedlysmart.com/hfhtmlcss/contest.php" method="POST">

<input type="text" name="firstname" value=""><br>

<input type="text" name="lastname" value=""><br>

<input type="submit">


3. server script

server script: most hosting companies support language like Python, Java, PHP , Java and so on4



4. text input

<input type="text" name="fullname">


5. submit button

<input type="submit">





6. radio input

<input type="radio" name="hotornot" value="hot">

<input type="radio" name="hotornot" value="not">

for a group of buttons, the name must be the same, while the value of each radio button, is different.

you can only choose one of the buttons




7. checkbox input

<input type="checkbox" name="spice" value="Salt">

<input type="checkbox" name="spice" value="pepper">


you can choose more than one checkbox.




8. <textarea> element

<textarea name="comments" rows="10" cols="48"></textarea>




<select>

<select name="characters">

<options value="Buckaroo">Buckaroo Banzai </option>

<option value="Tommy">Percect Tommy</option>

</select>



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章