Sunday, July 14, 2013

HTML Chapter 8 _ HTML Forms

HTML form တြင္ input elements မ်ားျဖစ္ေသာ text fields, checkboxs, radio-buttons, submit buttons စသည္တို. အျပင္ select lists, textarea, fieldset, legend and label elements ေတြလည္း ပါ၀င္ႏိုင္ ပါတယ္။ HTML form ကို <form> tag ျဖင့္ ေရးရပါတယ္။ <form> tag ထဲမွာမွ input elements ေတြအတြက္ <input type=”text”> tag ျဖင့္ ေရးပါတယ္။ တစ္ခုျခင္းစီ ကို example မ်ားျဖင့္ ေလ့လာၾကည့္ပါ။

Text Fields

<!DOCTYPE html>
<html>
<body>
    <form>
    First name: <input type="text" name="firstname"><br><br>
    Last name:<input type="text" name="lastname">
    </form>
</body>
</html>



Password Field

<!DOCTYPE html>
<html>
<body>
    <form>
    Password:<input type="password" name="pwd">
    </form>
</body>
</html>

Browser တြင္ စာရိုက္ထည့္ၾကည့္ပါက ေအာက္ပါအတိုင္းျမင္ရမွာပါ။


Radio Buttons

<!DOCTYPE html>
<html>
<body>
    <form>
    <input type="radio" name="sex" value="male"> Male<br>
    <input type="radio" name="sex" value="female">Female
    </form>
</body>
</html>






Checkboxes

<!DOCTYPE html>
<html>
<body>
<form>
<input type="checkbox" name="vehicle" value="Bike"> I have a bike <br>
<input type="checkbox" name="vehicle" value="Car"> I have a car
</form>
</body>
</html>



Submit Button

Submit button ကို <input type=”submit”> tag ျဖင့္ ေရးပါတယ္။

<!DOCTYPE html>
<html>
<body>
<form name="input" action="html_form_action.asp" method="get">
Username:<input type="text" name="user">
<input type="submit" value="Submit">
</form>
</body>
</html>


No comments:

Post a Comment