7-2 表單???其???件

@ӪiH]t\hP汱]Form Controls^Aκ٬u椸v]Form Elements^AoǪ椸UPSʡAHKqϥΪPAơC`Ϊ椸UCXءG

  1. r]Text^GoO̱`Ψ쪺AiHϥΪ̶JrA~[pUG

    lXpUG

    <input type=text value="Roger Jang" id=myTextId>
  2. rϰ]Textarea^GiHϥΪ̶JhCrA~[pUG

    lXpUG

    <textarea name="comments" cols=50 rows=3 id=myTextareaId>oӰݨܦ...uN|Aਥ...</textarea>
  3. s]Button^GOΪsAiϥΪIA~[pUG

    lXpUG

    <input type=button value="test button" id=myButtonId>
  4. ְO]Checkbox^GOΪְOAiϥΪIAܮְOGA~[pUG

    uʥN Web{]p ƭȤk

    lXpUG

    <input type=checkbox id=myCheckbox1>uʥN <input type=checkbox id=myCheckbox2 checked>Web{]p <input type=checkbox id=myCheckbox3>ƭȤk
  5. ְOs]Radio^GOΪְOsAiϥΪIAܮְOGCpGbP@Ӫ椤AƭӦְOsۦP name ݩʡAhoǦְOsNuv\AAXΩﶵAҦpʧOA~[pUG

    k k

    lXpUG

    k<input type=radio name=gender> k<input type=radio name=gender checked>
  6. á]Hidden^GUWqA|X{bWA\ObǰeϥΪ̤ݪDTA~[pUG

    ]ݤI^

    lXpUG

    <input type=hidden value="hidden value" id=myHiddenId>
  7. KX]Password^G\OϥΪ̿JKXA]e{ɡAݤJrA~[pUG

    lXpUG

    <input type=password value="test1234" id=myPasswordId>
  8. ]Select^GiϥΪ̸gѤUԦAiA~[pUG

    lXpUG

    <p class=example align=center><select size=3 id=mySelectId> <option>Ųy <option selected>y <option>y <option>]y </select>
  9. ƿ]Select Multiple^GiϥΪ̸gѤUԦAiƿA~[pUG

    Yn[JhӿﶵAiHU Ctrl AAηƹIһݿﶵA]iHU Shift AAηƹIAiH@hӿﶵClXpUG

    <select size=3 multiple id=mySelectId2> <option selected>ªs <option>F <option selected>F <option>ڶ붩 </select>
  10. ɮס]File^GiϥΪ̿wЪɮסAq`ΩɮפWǡA~[pUG

    ϥΪ̥iHIus...vsӿɮסAYAtXAݪ{XANiHiɮפWǡClXpUG

    <input type=file id=myFileId>
  11. ]]Reset^Gi]A檺ﶵΤrܦ^w]ȡA~[pUG

    lXpUG

    <input type=reset id=myResetId>
  12. eX]Submit^GiϥΪ̱NTeAA~[pUG

    lXpUG

    <input type=submit id=mySubmitId>
C@Ӫ汱AƤQөʽAiڭ̳]woDZ~[MSʡAYnCXoDZʽAiHѦҤUCѥЪdҡG
  1. r]Text^GformControlText01.htm
  2. rϰ]Textarea^GformControlTextarea01.htm
  3. s]Button^GformControlButton01.htm
  4. ְO]Checkbox^GformControlCheckbox01.htm
  5. ְOs]Radio^GformControlRadio01.htm
  6. á]Hidden^GformControlHidden01.htm
  7. KX]Password^GformControlPassword01.htm
  8. ]Select^GformControlSelectSingle01.htm
  9. ƿ]Select Multiple^GformControlSelectMultiple01.htm
  10. ɮס]File^GformControlFile01.htm
  11. ]]Reset^GformControlReset01.htm
  12. eX]Submit^GformControlSubmit01.htm
ѩgTAbCXWzҦdҪlXCbȥH@ӽdҨӻrϰ챱UةʽAdҦpUG

Example]formControlTextarea01.htm^G

bWzdҤAڭ̻XӭnʽG

WzdҪlɦpUG

lɡ]formControlTextarea01.htm^G]ǦϰUYi^
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
</head>

<body>
<h2 align=center>椸 textarea ʽC</h2>
<hr>

<b>e{覡</b>G
<textarea name="comments" cols=50 rows=3 id=myTextareaId>
oӰݨܦ...
uN|Aਥ...
</textarea>
<script>
//obj=document.all["myTextareaId"];
obj=document.getElementById("myTextareaId");
</script>
<script src="utility.js"></script>
<p><b>lX</b>G
<script>sourcePrint(obj)</script>
<p><b>ʽƧǦC</b>G
<p><script>propertyPrint(obj, "obj")</script>

<hr>
</body>
</html>


JavaScript {]pPΡGΩΤ