第三篇
HTML教學
第十節
特殊語法
加線條美化型表單 FieldSet 範例
<Form>
請輸入下面資料
姓名:
地址:
年齡:
電話:
HTML標籤
<
FieldSet
>
<
Legend
>
請輸入下面資料
<
/Legend
>
姓名:
<
Input
Type
="
Text
"
Name
="
name
"
>
<
BR
>
地址:
<
Input
Type
="
Text
"
Name
="
adds
"
Size
="
25
"
>
<
BR
>
年齡:
<
Input
Type
="
Text
"
Name
="
old
"
Size
="
5"
Maxlenght
="
3
"
>
<
BR
>
電話:
<
Input
Type
="
Text
"
Name
="
tel
"
Size
="
10"
Value
="
(02)
"
>
<
BR
>
<
/FieldSet
>
您懂 HomePage 嗎?請選擇
完全不懂
有聽說過
曾經寫過
經常看過
我設計過
HTML標籤
<
FieldSet
>
<
Legend
>
您懂 HomePage 嗎請選擇
<
/Legend
>
<
Input
Type
="
CheckBox
"
Name
="
ans01
"
value
="
完全不懂
"
>
完全不懂
<
BR
>
<
Input
Type
="
CheckBox
"
Name
="
ans02
"
value
="
有聽說過
"
Checked
>
有聽說過
<
BR
>
<
Input
Type
="
CheckBox
"
Name
="
ans03
"
value
="
曾經寫過
"
>
曾經寫過
<
BR
>
<
Input
Type
="
CheckBox
"
Name
="
ans04
"
value
="
經常看過
"
>
經常看過
<
BR
>
<
Input
Type
="
CheckBox
"
Name
="
ans05
"
value
="
我設計過
"
>
我設計過
<
BR
>
<
/FieldSet
>
</Form>
<
FieldSet
>
使用時機:用於您希望美化表單的外框而已。
適用於
Internet Explorer 6
、
Mozilla Firefox 2
及
Netscape Browser 8
瀏覽器,惟外貌有些不一樣。
<
Form
>
...
<
/Form
>
表單開始與結束宣告,此對標籤絕對不能省略。
<
FieldSet
>
...
<
/FieldSet
>
美化表單範圍開始與結束宣告,此對標籤最好不要省略。
<
Legend
>
...
<
/Legend
>
表單標題文字範圍開始與結束宣告,此對標籤不能省略。
屬性
Name
="
資料欄位名稱
"
為必要設定值,提供給後端程式處理的變數值
(取名稱時最好與欄位有關)
。
其他
屬性
標籤用法與前面相同(略)。