form element in HTML--Part1

本文详细解释了浏览器加载HTML页面时如何处理表单元素,包括输入数据、提交表单到服务器以及服务器响应的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值