ุฒู ู
ุง ุนุฑููุง ูู ู
ูุงู Forms HTMLุ ุงูู <form>
ุจุชุญุชูู ุนูู ุนูุงุตุฑ ุฅุฏุฎุงู ุนุดุงู ูุฌู
ุน ุจูุงูุงุช ุงูููุฒุฑ. ุงูุนูุตุฑ ุงูุฃูุซุฑ ุงุณุชุฎุฏุงู
ูุง ุฌูู ุงูููุฑู
ูู ุงูู <input>
.
ุนูุตุฑ ุงูู <input>
ุฏู ุฃูู
ูุฃูุชุฑ ุนูุตุฑ ุจูุณุชุฎุฏู
ู ูู ุงูููุฑู
. ุดูู ููุธููุฉ ุงูู <input>
ุจูุชุบูุฑูุง ุจุดูู ูุจูุฑ ุฌุฏูุง ุญุณุจ ููู
ุฉ ุงูู type
attribute ุงููู ุจูุญุฏุฏู.
ุงูู cheat sheet ุฏู ูุชููู ู
ุฑุฌุน ููู ุนุดุงู ุชุฎุชุงุฑ ุงูู type
ุงูู
ูุงุณุจ ููู ุญุงูุฉ. ุฃุบูุจ ุงูู inputs ุฏู ููุถู ุชุณุชุฎุฏู
ู
ุนุงูุง <label>
ุนุดุงู ุงูู accessibility.
ุฃููุงุน ุงูู type
ููู <input>
text
- ุงููุธููุฉ: ุจูุนู ู ุญูู ูุตู ุนุงุฏู ู ู ุณุทุฑ ูุงุญุฏ (single-line text field) ุงูููุฒุฑ ููุฏุฑ ููุชุจ ููู.
- ุฏู ุงูู default value ูู ู
ุญุฏุฏุชุด
type
.
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"> <!-- Standard text input -->
- ุงููุธููุฉ: ุฒู ุงูู
text
ุ ุจุณ ุงูููู ุฉ ุงููู ุจุชุชูุชุจ ุจุชููู ู ุฎููุฉ (obscured)ุ ุนุดุงู ูุฏู ู ูุงุณุจ ููู ุนููู ุงุช ุงูุญุณุงุณุฉ ุฒู ุงูุจุงุณูุฑุฏุงุช. - ุงูููุงู ุจูุธูุฑ ุนูู ุดูู ููุท ุฃู ูุฌูู .
<label for="pwd">Password:</label>
<input type="password" id="pwd" name="pwd"> <!-- Input is masked -->
button
- ุงููุธููุฉ: ุจูุนุฑุถ ุฒุฑุงุฑ ุนุงุฏู ุชูุฏุฑ ุชุฏูุณ ุนููู (clickable button).
- ุบุงูุจูุง ุจูุณุชุฎุฏู
ู ุนุดุงู ูููุฐ script (ููุฏ JavaScript) ูู
ุง ูุฏูุณ ุนููู ุจุงุณุชุฎุฏุงู
ุงูู
onclick
attribute.
<!-- Executes the msg() JavaScript function on click -->
<input type="button" value="Click me" onclick="msg()" />
- ู
ูุญูุธุฉ: ู
ู
ูู ุจุฑุถู ุชุนู
ู ุฒุฑุงูุฑ ุจุงุณุชุฎุฏุงู
ุชุงุฌ ุงูู Buttons HTML. ุงูู
ูุฒุฉ ูู
<button>
ุฅูู ุชูุฏุฑ ุชุญุท ุฌูุงู ู ุญุชูู ุฒู ูุตูุต ูุตูุฑุ ู ุด ู ุฌุฑุฏ ููู ุฉ ูู ุงููvalue
.<button onclick="alert('Are you sure you want to continue?')"> <!-- Can contain images and text --> <img src="https://yourserver.com/button_img.jpg" alt="Submit the form" height="64" width="64"> Confirm </button>
checkbox
- ุงููุธููุฉ: ุจูุนู ู checkbox (ู ุฑุจุน ุงุฎุชูุงุฑ) ุจูุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ููู ุฉ ูุงุญุฏุฉ ุฃู ููุบู ุงุฎุชูุงุฑูุง.
- ุจูุณุชุฎุฏู ู ูู ุง ูููู ุนูุฏ ุงูููุฒุฑ ู ุฌู ูุนุฉ ุฎูุงุฑุงุช ู ุญุฏูุฏุฉ ูุนุงูุฒููู ููุฏุฑ ูุฎุชุงุฑ ุตูุฑ ุฃู ุฃูุชุฑ ู ู ุงูุฎูุงุฑุงุช ุฏู.
<!-- User can select zero or more options -->
<input type="checkbox" id="dog" name="likes" value="Dog"> <!-- Added name attribute -->
<label for="dog">I like dogs</label>
<input type="checkbox" id="cat" name="likes" value="Cat"> <!-- Added name attribute -->
<label for="cat">I like cats</label>
- ุนุดุงู ุชุฎูู ูุงุญุฏ ู
ููู
ู
ุชุนูู
ุนููู ุจุดูู ุงูุชุฑุงุถูุ ุงุณุชุฎุฏู
ุงูู
checked
attribute:<input type="checkbox" id="bike" name="vehicle" value="bike" checked /> <!-- Pre-selected checkbox -->
radio
- ุงููุธููุฉ: ุจูุนุฑุถ radio button (ุฒุฑ ุงุฎุชูุงุฑ ุฏุงุฆุฑู).
- ุจูุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ููู ุฉ ูุงุญุฏุฉ ุจุณ ู ู ุจูู ู ุฌู ูุนุฉ ุฎูุงุฑุงุช.
- ุจูุชูุฏู
ูุง ุนุงุฏุฉ ูู ู
ุฌู
ูุนุงุช (radio groups): ู
ุฌู
ูุนุฉ radio buttons ูููู
ููุณ ุงูู
name
attribute. ูู ุง ูููู ูููู ููุณ ุงููname
ุ ุงูููุฒุฑ ู ูููุนุด ูุฎุชุงุฑ ุบูุฑ ูุงุญุฏ ุจุณ ู ููู ูู ููุณ ุงูููุช.
<!-- User can select only one option with the same name -->
<input type="radio" id="light" name="theme" value="Light"> <!-- Value is important -->
<label for="light">Light</label>
<input type="radio" id="dark" name="theme" value="Dark">
<label for="dark">Dark</label>
- ุฒู ุงูู checkboxุ ู
ู
ูู ุชุณุชุฎุฏู
checked
ุนุดุงู ุชุฎูู ุงุฎุชูุงุฑ ุงูุชุฑุงุถู. - ุงูู
value
ููุง ู ูู ุฌุฏูุง ุนุดุงู ูู ุฏู ุงููู ุจูุชุจุนุช ููุณูุฑูุฑ ูู ุง ุงูููุฒุฑ ูุฎุชุงุฑ ุงูู radio button ุฏู.
submit
- ุงููุธููุฉ: ุจูุนุฑุถ ุฒุฑุงุฑ submit. ูู
ุง ุงูููุฒุฑ ุจูุฏูุณ ุนูููุ ุจูุจุนุช ูู ุงูููู
ุงููู ูู ุงูููุฑู
ููู form-handler (ุงููู ู
ุชุญุฏุฏ ูู ุงูู
action
attribute ุจุชุงุน ุงูููุฑู ). - ุงุชููู ูุง ุนููุง ุจุงูุชูุตูู ูู submit HTML
<form action="myserver.com" method="POST">
<!-- Other form elements go here -->
<input type="submit" value="Submit" /> <!-- Submits the form data -->
</form>
- ูู ู
ุญุทุชุด
value
ููุฒุฑุงุฑุ ููุงุฎุฏ ููู ุฉ ุงูุชุฑุงุถูุฉ (ุฒู โSubmitโ).
reset
- ุงููุธููุฉ: ุจูุนุฑุถ ุฒุฑุงุฑ ุจูุฑุฌุน ูู ููู ุงูููุฑู ูููู ูุง ุงูุงูุชุฑุงุถูุฉ (default values).
<input type="reset" value="Reset"> <!-- Resets form fields to default -->
date
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู (control) ุนุดุงู ุงูููุฒุฑ ูุฏุฎู ุชุงุฑูุฎ (ุณูุฉุ ุดูุฑุ ููู ) ู ู ุบูุฑ ููุช. ุดูู ุงูุฃุฏุงุฉ ุจูุฎุชูู ุญุณุจ ุงูู ุชุตูุญ.
<label for="dob">Date of birth:</label>
<input type="date" id="dob" name="date_of_birth"> <!-- Date picker -->
- ู
ู
ูู ุชุณุชุฎุฏู
min
ูmax
ุนุดุงู ุชุญุฏุฏ ู ุฏู ุชูุงุฑูุฎ ู ุณู ูุญ ุจูู.
<form>
ย ย <labelย for="datemax">Enter a date before 1980-01-01:</label>
ย ย <inputย type="date"ย id="datemax"ย name="datemax"ย max="1979-12-31"><br><br>
ย ย <labelย for="datemin">Enter a date after 2000-01-01:</label>
ย ย <inputย type="date"ย id="datemin"ย name="datemin"ย min="2000-01-02">
</form>
datetime-local
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู ุนุดุงู ุงูููุฒุฑ ูุฏุฎู ุชุงุฑูุฎ ูููุช ู ุน ุจุนุถ (ุณูุฉุ ุดูุฑุ ููู ุ ุณุงุนุฉุ ุฏูููุฉ).
<label for="birthdaytime">Birthday (date and time):</label>
<input type="datetime-local" id="birthdaytime" name="birthdaytime"> <!-- Date and time picker -->
time
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู ุนุดุงู ุงูููุฒุฑ ูุฏุฎู ููุช (ุณุงุนุฉ ูุฏูููุฉ) ู ู ุบูุฑ time zone.
<label for="appt">Select a time:</label>
<input type="time" id="appt" name="appt"> <!-- Time picker -->
month
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู ุนุดุงู ุงูููุฒุฑ ูุฏุฎู ุดูุฑ ูุณูุฉุ ู ู ุบูุฑ time zone.
- ุฎุฏ ุจุงูู: ุฏู ููุน ุฌุฏูุฏ ูุณุจููุง ูู ู ูู ู ุด ูู ุงูู ุชุตูุญุงุช ุชุฏุนู ู. (ุงุชุฃูุฏ ู ู Can I use)
<label for="bdaymonth">Birthday (month and year):</label>
<input type="month" id="bdaymonth" name="bdaymonth" min="1930-01" value="2000-01"> <!-- Month and year picker -->
week
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู ุนุดุงู ุงูููุฒุฑ ูุฏุฎู ุชุงุฑูุฎ ุนุจุงุฑุฉ ุนู ุฑูู ุงูุฃุณุจูุน ูู ุงูุณูุฉ ูุงูุณูุฉ ููุณูุงุ ู ู ุบูุฑ time zone.
- ุฎุฏ ุจุงูู: ุฏู ุจุฑุถู ููุน ุฌุฏูุฏ ูู ู ูู ู ุด ูู ุงูู ุชุตูุญุงุช ุชุฏุนู ู.
<label for="week">Select a week:</label>
<input type="week" id="week" name="week"> <!-- Week and year picker -->
email
- ุงููุธููุฉ: ุจูุนู ู ุญูู ู ุฎุตุต ูุนููุงู ุงูุจุฑูุฏ ุงูุฅููุชุฑููู (email address).
- ุจูุจูู ุดุจู ุงูู
text
ุงูุนุงุฏูุ ููู ุงูู ุชุตูุญ ุจูุนู ูู validation (ุชุญูู) ุชููุงุฆู ุฅู ุงูุตูุบุฉ ุจุชุงุนุชู ุตุญ ูู ุง ุชูุฌู ุชุนู ู submit ููููุฑู . - ุจุนุถ ุงูู ูุจุงููุงุช ุจุชุบูุฑ ุดูู ุงูููุจูุฑุฏ ุนุดุงู ุชุณูู ูุชุงุจุฉ ุงูุฅูู ูู (ุฒู ุฅุถุงูุฉ ุฒุฑุงุฑ .com).
<label for="email">Enter your email:</label>
<input type="email" id="email" name="email"> <!-- Validates email format on submit -->
tel
- ุงููุธููุฉ: ุจูุนู ู ุญูู ู ุฎุตุต ูุฑูู ุงูุชููููู.
- ุงูู
ุชุตูุญุงุช ุงููู ู
ุด ุจุชุฏุนู
ู ุจุชุชุนุงู
ู ู
ุนุงู ูุฃูู
text
. - ู
ู
ูู ุชุณุชุฎุฏู
ุงูู
pattern
attribute ุนุดุงู ุชุนู ู validation ุนูู ุดูู ุงูุฑูู ุงูู ุทููุจ.
<label for="phone">Enter your phone number:</label>
<!-- The pattern attribute defines a regex for input validation -->
<input type="tel" id="phone" name="phone" pattern="[+]{1}[0-9]{11,14}"> <!-- Example pattern for international numbers -->
url
- ุงููุธููุฉ: ุจูุนู ู ุญูู ู ุฎุตุต ููู URL (ุนููุงู ู ููุน ููุจ).
- ุฒู ุงูู
email
ุ ุงูู ุชุตูุญ ุจูุนู ูู validation ุชููุงุฆู ููุตูุบุฉ ุจุชุงุนุชู ุนูุฏ ุงูู submit. - ุจุนุถ ุงูู ูุจุงููุงุช ุจุชุบูุฑ ุงูููุจูุฑุฏ ุนุดุงู ุชุณูู ูุชุงุจุฉ ุงูู URL.
<label for="homepage">Add your homepage:</label>
<input type="url" id="homepage" name="homepage"> <!-- Validates URL format on submit -->
file
- ุงููุธููุฉ: ุจูุนุฑุถ ุฃุฏุงุฉ ุชุญูู ุจุชุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ู ูู ู ู ุฌูุงุฒู ุนุดุงู ูุนู ูู upload. ุจูุธูุฑ ุฒุฑุงุฑ ุฒู โBrowseโ ุฃู โChoose Fileโ.
<label for="myfile">Select a file:</label>
<input type="file" id="myfile" name="myfile"> <!-- File selection control -->
- ุงูู
accept
attribute: ู ู ูู ุชุณุชุฎุฏู ู ุนุดุงู ุชุญุฏุฏ ุฃููุงุน ุงูู ููุงุช ุงูู ุณู ูุญ ุจููุง (ุงูู ุชุตูุญ ููุญุงูู ูููุชุฑ ุงูู ููุงุช ููููุฒุฑุ ููู ุฏู ู ุด ุจูู ูุน ุงูููุฒุฑ ูุฎุชุงุฑ ููุน ุชุงูู).<!-- Allow only PNG images --> <input type="file" accept="image/png" name="profilePicPng"> <!-- Allow any image type --> <input type="file" accept="image/*" name="profilePicAny">
- ุงูู
multiple
attribute: ูู ุถูุชูุ ููุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ุฃูุชุฑ ู ู ู ูู ูู ููุณ ุงูููุช.<!-- Allow multiple image file selections --> <input type="file" accept="image/*" name="galleryPics" multiple/>
hidden
- ุงููุธููุฉ: ุจูุนู ู ุญูู ุฅุฏุฎุงู ุจูููู ู ุฎูู ูู ุด ุธุงูุฑ ููููุฒุฑ ูู ุงูุตูุญุฉ.
- ูุงูุฏุชู ุฅููุ ุจูุณุชุฎุฏู
ู ุนุดุงู ูุจุนุช ุจูุงูุงุช ููุณูุฑูุฑ ุงูููุฒุฑ ู
ุด ู
ุญุชุงุฌ ูุดูููุง ุฃู ูุนุฏููุงุ ุฒู ู
ุซููุง
id
ุจุชุงุน ุนู ูู ุฃู ุฃู ุจูุงูุงุช ุชุชุจุน ุชุงููุฉ.
<form>
<label for="fname"> First name:</label>
<input type="text" id="fname" name="fname"> <br><br>
<!-- This field is hidden but its value is submitted -->
<input type="hidden" id="custID" name="custId" value="3487">
<input type="submit" value="Submit">
</form>
- ุชุญุฐูุฑ: ุฑุบู ุฅู ุงูุญูู ุฏู ู ุด ุธุงูุฑุ ุฃู ุญุฏ ููุฏุฑ ูุดูู ููู ุชู ููุนุฏููุง ุจุงุณุชุฎุฏุงู ุฃุฏูุงุช ุงูู ุทูุฑูู (developer tools) ูู ุงูู ุชุตูุญ ุฃู ุนู ุทุฑูู โView Sourceโ. ุฃูุนู ุชุณุชุฎุฏู ู ููุณููุฉ ุฃู ุงู!
image
- ุงููุธููุฉ: ุจูุนุฑุถ ุตูุฑุฉ ุจุชุดุชุบู ูุฃููุง ุฒุฑุงุฑ submit ุฑุณูู ู (graphical submit button).
- ูุงุฒู
ุชุณุชุฎุฏู
ุงูู
src
attribute ุนุดุงู ุชุญุฏุฏ ู ูุงู ู ูู ุงูุตูุฑุฉ.
<!-- Image acts as a submit button -->
<input type="image" src="submit_img.png" alt="Submit" width="48" height="48">
number
- ุงููุธููุฉ: ุจูุนู ู ุญูู ู ุฎุตุต ูุฅุฏุฎุงู ุงูุฃุฑูุงู . ุงูู ุชุตูุญ ุบุงูุจูุง ุจูุนุฑุถ ุฃุณูู ุตุบูุฑุฉ ุนุดุงู ุชุฒูุฏ ุฃู ุชููุต ุงูุฑูู .
- ู
ู
ูู ุชุณุชุฎุฏู
attributes ุฒู
min
,max
,step
ุนุดุงู ุชุญุท ูููุฏ ุนูู ุงูุฃุฑูุงู ุงูู ุณู ูุญุฉ.
<label for="quantity">Quantity (between 1 and 5):</label>
<input type="number" id="quantity" name="quantity" min="1" max="5"> <!-- Numeric input with range -->
range
- ุงููุธููุฉ: ุจูุนุฑุถ widget (ุฒู slider ุฃู ู
ุคุดุฑ) ุนุดุงู ุงูููุฒุฑ ูุฎุชุงุฑ ุฑูู
ูู ู
ุฏู ู
ุนูู. ุงูููู
ุฉ ุงูุฏูููุฉ ููุณูุง ู
ุด ุจุชููู ู
ูู
ุฉ ุฃูู ุฒู ูู ุญุงูุฉ ุงูู
number
. - ุจูุณุชุฎุฏู
min
ูmax
ุนุดุงู ูุญุฏุฏ ุงูู ุฏู ุงูู ุณู ูุญ. ุงูููู ุฉ ุงูุงูุชุฑุงุถูุฉ ููู ุฏู ูู ู ู 0 ูู 100.
<label for="volume">Volume:</label>
<!-- Slider control for selecting a value in a range -->
<input type="range" id="volume" name="volume" min="0" max="10">
search
- ุงููุธููุฉ: ุจูุนู ู ุญูู ูุตู ู ุฎุตุต ููุชุงุจุฉ ุงุณุชุนูุงู ุงุช ุงูุจุญุซ (search query).
- ู
ู ูุงุญูุฉ ุงููุธููุฉ ูู ุฒู ุงูู
text
ุจุงูุธุจุทุ ููู ู ู ูู ุงูู ุชุตูุญ ูุนุฑุถู ุจุดูู ู ุฎุชูู ุดููุฉ (ุฒู ุฅูู ูุญุท ุนูุงู ุฉ x ุตุบูุฑุฉ ูู ุณุญ ุงููุต).
<label for="gsearch">Search in Google:</label>
<input type="search" id="gsearch" name="gsearch"> <!-- Text input styled for search -->
color
- ุงููุธููุฉ: ุจูุนู ู ุญูู ุจูุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ููู (ุบุงูุจูุง ุจููุชุญ color picker).
- ู ุด ู ุฏุนูู ูู ุงูู ุชุตูุญุงุช ุงููุฏูู ุฉ (ุฒู IE). ุงุชุฃูุฏ ู ู Can I use.
<label for="favcolor">Select your favorite color:</label>
<input type="color" id="favcolor" name="favcolor"> <!-- Color picker control -->
ุฃูู
ุงูู Attributes ูุนูุงุตุฑ ุงูู <input>
(ูุบูุฑูุง)
ุงุชููู ูุง ุนู ุงูู Attributes HTML ูุจู ูุฏุง
ุบูุฑ ุงูู type
ุ ููู attributes ุชุงููุฉ ู
ูู
ุฉ ุฌุฏูุง ุจูุณุชุฎุฏู
ูุง ู
ุน ุงูู <input>
ูุนูุงุตุฑ ุชุงููุฉ ูู ุงูููุฑู
:
name
- ุงูุฃูู ูุฉ: ุถุฑูุฑู ุฌุฏูุง ูุฃู Input type ุนุงูุฒ ุชุจุนุช ููู ุชู ููุณูุฑูุฑ.
- ูุธููุชู: ุจูุญุฏุฏ ุงุณู
ุงูุญูู ุฏู. ูู
ุง ุงูููุฑู
ุจุชุชุจุนุชุ ุงูุจูุงูุงุช ุจุชูุตู ููุณูุฑูุฑ ุนูู ุดูู
name=value
. - ูู ุญุฐูุช ุงูู
name
attributeุ ููู ุฉ ุงูุญูู ุฏู ู ุด ูุชุชุจุนุช ุฃุตููุง. - ูุบุงุช ุงูู Backend ุจุชุณุชุฎุฏู
ุงูู
name
ุฏู ุนุดุงู ุชุนุฑู ูู ููู ุฉ ุฌุงูุฉ ุจุชุงุนุฉ ุฃููู ุญูู ุจุงูุธุจุท.
<!-- Server-side will receive: firstname=Mahmoud -->
<input id="fname" type="text" name="firstname" />
- ู
ูุญูุธุฉ: ู
ูููุนุด ุชูุฑุฑ ููุณ ุงูู
name
ูุนูุงุตุฑ ู ุฎุชููุฉ ูู ููุณ ุงูููุฑู ุฅูุง ูู ุญุงูุฉ ุงูู radio buttons (ุนุดุงู ุชุนู ู ู ุฌู ูุนุฉ) ุฃู ุงูู checkboxes (ูู ุนุงูุฒ ุชุฌู ุน ุงูููู ูู list ุฃู array ูู ุงูู backend). ูู ูุฑุฑุช ุงููname
ูุนูุงุตุฑtext
ู ุซููุงุ ู ู ูู ูุนู ู override (ุขุฎุฑ ููู ุฉ ูู ุงููู ูุชุชุจุนุช) ูุฏู ููุณุจุจ ู ุดุงูู.
value
- ุงููุธููุฉ: ุจูุญุฏุฏ ุงูููู ุฉ ุงูู ุจุฏุฆูุฉ (initial value) ููุญูู.
- ู
ูู
ุฌุฏูุง ู
ุน ุงูู
checkbox
ูุงููradio
ุนุดุงู ูู ุฏู ุงููู ุจูุญุฏุฏ ุงูููู ุฉ ุงููู ูุชุชุจุนุช ููุณูุฑูุฑ ูู ุง ุงูููุฒุฑ ูุฎุชุงุฑ ุงูุนูุตุฑ ุฏู. - ู
ุน ุงูู
text
,password
, ูุบูุฑูุงุ ุจุชุจูู ุงูููู ุฉ ุงููู ุธุงูุฑุฉ ูู ุงูุญูู ุฃูู ู ุง ุงูุตูุญุฉ ุชุญู ู.
<input type="text" id="fname" name="fname" value="John"> <!-- Field will initially contain "John" -->
<input type="radio" id="html" name="fav_language" value="HTML"> <!-- If selected, submits fav_language=HTML -->
readonly
- ุงููุธููุฉ: ุจูุฎูู ุงูุญูู ูููุฑุงุกุฉ ููุท (read-only).
- ุงูููุฒุฑ ู ููุฏุฑุด ูุนุฏู ุงูููู ุฉุ ููู ููุฏุฑ ููุตูู ุจุงูู tabุ ููุนู ู highlight ูููุตุ ูููุณุฎู.
- ู
ูู
: ููู
ุฉ ุงูุญูู ุงูู
readonly
ุจุชุชุจุนุช ู ุน ุงูููุฑู ูู ุง ุชุนู ู submit.
<input type="text" id="fname" name="fname" value="John" readonly> <!-- Value cannot be changed by user, but is submitted -->
disabled
- ุงููุธููุฉ: ุจูุนุทู ุงูุญูู (disabled).
- ุงูุญูู ุจูุจูู ุบูุฑ ูุงุจู ููุงุณุชุฎุฏุงู ูู ูููุนุด ุชุฏูุณ ุนููู ุฃู ุชุนุฏูู. ุดููู ูู ุงู ุจูุจูู ุจุงูุช ุบุงูุจูุง.
- ู
ูู
: ููู
ุฉ ุงูุญูู ุงูู
disabled
ู ุด ุจุชุชุจุนุช ู ุน ุงูููุฑู ูู ุง ุชุนู ู submit.
<input type="text" id="fname" name="fname" value="John" disabled> <!-- Field is unusable and value is NOT submitted -->
min
ู max
- ุงููุธููุฉ: ุจูุญุฏุฏูุง ุฃูู ููู ุฉ (minimum) ูุฃูุตู ููู ุฉ (maximum) ู ุณู ูุญุฉ ููุญูู.
- ุจูุดุชุบููุง ู
ุน ุฃููุงุน ุงูู input ุฏู:
number
,range
,date
,datetime-local
,month
,time
,week
. - ู ู ูู ุชุณุชุฎุฏู ูู ู ุน ุจุนุถ ุนุดุงู ุชุญุฏุฏ ู ุฏู ู ุนูู ููููู ุงูู ุณู ูุญุฉ.
<input type="number" id="quantity" name="quantity" min="1" max="5"> <!-- Allows numbers between 1 and 5 -->
<input type="date" id="datemax" name="datemax" max="1979-12-31"> <!-- Latest allowed date -->
maxlength
ู minlength
- ุงููุธููุฉ: ุจูุญุฏุฏูุง ุฃูุตู (maximum) ูุฃูู (minimum) ุนุฏุฏ ุญุฑูู ู ุณู ูุญ ุจูู ูู ุงูุญูู.
- ุจูุณุชุฎุฏู
ูู
ู
ุน ุฃููุงุน ุงูุฅุฏุฎุงู ุงููุตูุฉ ุฒู
text
,password
,search
,tel
,url
,email
.
<input type="text" name="username" minlength="5" maxlength="15"> <!-- Defines allowed text length -->
placeholder
- ุงููุธููุฉ: ุจูุนุฑุถ ูุต ุชูู ูุญู (hint) ู ุคูุช ุฌูู ุงูุญูู ูุจู ู ุง ุงูููุฒุฑ ูุจุฏุฃ ููุชุจ.
- ุงูุชูู ูุญ ุฏู ุจููุตู ุงูููู ุฉ ุงูู ุชููุนุฉ (ุฒู ู ุซุงู ุฃู ูุตู ูุตูุฑ ููุตูุบุฉ ุงูู ุทููุจุฉ). ุจูุฎุชูู ุฃูู ู ุง ุงูููุฒุฑ ููุชุจ.
- ุจูุดุชุบู ู
ุน ุฃููุงุน ุงูู input ุฏู:
text
,search
,url
,number
,tel
,email
,password
.
<input type="tel" id="phone" name="phone" placeholder="123-45-678"> <!-- Hint shown before user types -->
autofocus
- ุงููุธููุฉ: ุจูุฎูู ุงูู focus (ู ุคุดุฑ ุงููุชุงุจุฉ) ูุฑูุญ ุนูู ุงูุญูู ุฏู ุชููุงุฆููุง ุฃูู ู ุง ุงูุตูุญุฉ ุชุญู ู.
- ุงูู ูุฑูุถ ุชุณุชุฎุฏู ู ู ุฑุฉ ูุงุญุฏุฉ ุจุณ ูู ุงูุตูุญุฉ.
<input type="text" id="fname" name="fname" autofocus> <!-- Gets focus automatically on page load -->
required
- ุงููุธููุฉ: ุจููุถุญ ุฅู ุงูุญูู ุฏู ู ุทููุจ (required)ุ ูุงูููุฒุฑ ูุงุฒู ูุฏุฎู ููู ููู ุฉ ูู ูููุนุด ูุณูุจู ูุงุถู.
- ูู ุงูููุฒุฑ ุญุงูู ูุนู
ู submit ูุงูููุฑู
ูููุง ุญูู
required
ูุงุถูุ ุงูู ุชุตูุญ ููู ูุน ุงูู submission ูููุทูุน ุฑุณุงูุฉ ุชูุจูู.
<input type="email" name="email" required> <!-- This field must be filled out -->
checked
- ุงููุธููุฉ: ุจูุฎูู ุงูู
checkbox
ุฃู ุงููradio button
ู ุชุนูู ุนููู (checked) ุจุดูู ุงูุชุฑุงุถู ุฃูู ู ุง ุงูุตูุญุฉ ุชุญู ู.
<input type="radio" id="html" name="fav_language" value="HTML" checked> <!-- Default selected radio -->
<input type="checkbox" id="agree" name="agree" checked> <!-- Default checked checkbox -->
pattern
- ุงููุธููุฉ: ุจูุณู ุญูู ุชุญุฏุฏ regular expression (ุชุนุจูุฑ ูู ุทู) ุงูููู ุฉ ุงููู ุงูููุฒุฑ ุจูุฏุฎููุง ูุงุฒู ุชุทุงุจูู ุนุดุงู ุชุนุชุจุฑ ุตุญูุญุฉ.
- ุฏู ุจูููุฑ ุทุฑููุฉ ูููุฉ ููู client-side validation ูุฃุดูุงู ู ุนูุฏุฉ.
- ุจูุดุชุบู ู
ุน ุฃููุงุน ุฒู
text
,tel
,email
,url
,password
,search
.
<!-- Validates input against a regular expression -->
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}" required>
step
- ุงููุธููุฉ: ุจูุญุฏุฏ ุงูุฒูุงุฏุฉ ุฃู ุงูููุตุงู ุงูู
ุณู
ูุญ ุจููุง ูู ุงูููู
ุฉ ูู
ุง ุชุณุชุฎุฏู
ุงูุฃุณูู
(ู
ุน
type="number"
) ุฃู ุงูู slider (ู ุนtype="range"
).
<!-- Defines the allowed increments for number/range inputs -->
<input type="number" name="points" step="5" min="0" max="50"> <!-- Allowed values: 0, 5, 10... -->
ุนูุงุตุฑ ุชุงููุฉ ู ูู ุฉ ูู ุงูููุฑู
ุนูุตุฑ ุงูู <select>
- ุงููุธููุฉ: ุจูุนู ู ูุงูู ุฉ ู ูุณุฏูุฉ (drop-down list).
<label for="cars">Choose a car:</label>
<select name="cars" id="cars">
<!-- Options for the dropdown list -->
<option value="0">Volvo</option>
<option value="1">fiat</option>
<option>lambo</option> <!-- If value is omitted, text content is used -->
<option>mpw</option>
</select>
- ุนูุตุฑ
<option>
: ูู ุนูุตุฑ ุฌูู ุงููุงูู ุฉ ุจูุนุฑูู ุจุงุณุชุฎุฏุงู<option>
.- ุงูู
value
attribute ูู ุงูููู ุฉ ุงููู ูุชุชุจุนุช ููุณูุฑูุฑ ูู ุงูููุฒุฑ ุงุฎุชุงุฑ ุงูู option ุฏู. - ุงููุต ุงููู ุจูู
<option>
ู</option>
ูู ุงููู ุจูุธูุฑ ููููุฒุฑ ูู ุงููุงูู ุฉ.
- ุงูู
- ุงูุงุฎุชูุงุฑ ุงูุงูุชุฑุงุถู: ุฃูู
<option>
ูู ุงููุงูู ุฉ ูู ุงููู ุจูููู ู ุฎุชุงุฑ ุงูุชุฑุงุถููุง. - ุงูู
selected
attribute: ุนุดุงู ุชุฎูู option ู ุนูู ูู ุงููู ู ุฎุชุงุฑ ุงูุชุฑุงุถููุงุ ุถูููู ุงููselected
attribute.<option value="fiat" selected>Fiat</option> <!-- This option is pre-selected -->
- ุงูู
size
attribute: ุจูุญุฏุฏ ุนุฏุฏ ุงูุฎูุงุฑุงุช ุงููู ุจุชููู ุธุงูุฑุฉ ูู ุงููุงูู ุฉ ู ู ุบูุฑ ู ุง ุชูุชุญูุง. ูู ุฃูุจุฑ ู ู 1ุ ุดูููุง ุจูุชุบูุฑ ู ู ูุงูู ุฉ ู ูุณุฏูุฉ ูู list box.<!-- Displays 3 options at once --> <select id="cars" name="cars" size="3"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select>
- ุงูู
multiple
attribute: ูู ุถูุชูุ ุจูุณู ุญ ููููุฒุฑ ูุฎุชุงุฑ ุฃูุชุฑ ู ู option ูู ููุณ ุงูููุช (ุบุงูุจูุง ุนู ุทุฑูู ุงูุถุบุท ุนูู Ctrl ุฃู Shift ู ุน ุงููููู).<!-- Allows multiple selections (usually with Ctrl/Shift + click) --> <select id="cars" name="cars" size="4" multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select>
ุนูุตุฑ ุงูู <textarea>
- ุงููุธููุฉ: ุจูุนู ู ุญูู ุฅุฏุฎุงู ูุตู ู ุชุนุฏุฏ ุงูุฃุณุทุฑ (multi-line input field). ู ูุงุณุจ ูููุตูุต ุงูุทูููุฉ ุฒู ุงูุฑุณุงูู ุฃู ุงูุชุนูููุงุช.
<!-- Defines the initial visible size -->
<!-- The text between tags is the default value -->
<textarea name="message" rows="10" cols="30">The cat was playing in the garden.</textarea>
- ุงูู
rows
attribute: ุจูุญุฏุฏ ุงูุงุฑุชูุงุน ุงูู ุจุฏุฆู ููุญูู ุจุนุฏุฏ ุงูุณุทูุฑ ุงูุธุงูุฑุฉ. - ุงูู
cols
attribute: ุจูุญุฏุฏ ุงูุนุฑุถ ุงูู ุจุฏุฆู ููุญูู ุจุนุฏุฏ ุงูุญุฑูู ุงูุชูุฑูุจู ูู ุงูุณุทุฑ. - ู
ูุญูุธุฉ: ู
ู
ูู ุจุฑุถู ุชุชุญูู
ูู ุญุฌู
ุงูู
<textarea>
ุจุงุณุชุฎุฏุงู CSS.
ูุฏู ูุจูู ุบุทููุง ู
ุนุธู
ุฃููุงุน ุงูู <input>
ุงูู
ุดููุฑุฉ ูุงูู attributes ุงูู
ูู
ุฉ ุงููู ุจูุณุชุฎุฏู
ูุง ูู ุจูุงุก ุงูู Forms HTML.