HTML အကိုးအကား

အက္ခရာဖြင့် HTML HTML အမျိုးအစားအလိုက် HTML Browser ပံ့ပိုးမှု HTML အရည်အချင်းများ HTML ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းများ HTML ပွဲများ HTML အရောင်များ HTML Canvas HTML အသံ/ဗီဒီယို HTML အက္ခရာအစုံများ HTML Doctypes HTML URL ကုဒ် HTML ဘာသာစကားကုဒ်များ HTML နိုင်ငံကုဒ်များ HTTP မက်ဆေ့ခ်ျများ HTTP နည်းလမ်းများ PX မှ EM Converter ကီးဘုတ်ဖြတ်လမ်းများ


HTML <input> ပုံစံ Attribute

❮ HTML <input> tag

ဥပမာ

စာလုံးသုံးလုံးသာပါဝင်နိုင်သော ထည့်သွင်းအကွက်ပါရှိသော HTML ဖောင်ပုံစံတစ်ခု (နံပါတ်များ သို့မဟုတ် အထူးအက္ခရာများမပါ)။

<form action="/action_page.php">
  <label for="country_code">Country code:</label>
  <input type="text" id="country_code" name="country_code"
  pattern="[A-Za-z]{3}" title="Three letter country code"><br><br>
  <input type="submit">
</form>

အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။


အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

ရည်ညွှန်းချက်သည် ဖောင်တင်သွင်းမှုတွင် အစိတ်အပိုင်း ၏ တန်ဖိုးကို စစ်ဆေး patternထားသည့် ပုံမှန်ဖော်ပြချက်တစ်ခုကို သတ်မှတ် ပေးသည်။ <input>

မှတ်ချက်- ရည်ညွှန်းချက်သည် အောက်ပါ patternထည့်သွင်းမှုအမျိုးအစားများနှင့် အလုပ်လုပ်သည်- စာသား၊ ရက်စွဲ၊ ရှာဖွေမှု၊ url၊ ဖုန်း၊ အီးမေးလ်၊ နှင့် စကားဝှက်။

အကြံပြုချက်-title အသုံးပြုသူ ကို ကူညီရန် ပုံစံကို ဖော်ပြရန် ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းကို အသုံးပြုပါ။

အကြံပြုချက်- ကျွန်ုပ်တို့၏ JavaScript သင်ခန်းစာတွင် ပုံမှန်အသုံးအနှုန်းများ အကြောင်း ပိုမိုလေ့လာပါ ။


Browser ပံ့ပိုးမှု

ဇယားရှိ နံပါတ်များသည် attribute ကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးပါသည်။

Attribute
pattern 5.0 10.0 4.0 10.1 9.6

အထားအသို

<input pattern="regexp">

ရည်ညွှန်းတန်ဖိုးများ

Value Description
regexp Specifies a regular expression that the <input> element's value is checked against


နောက်ထပ် ဥပမာများ

ဥပမာ

type="password" ပါရှိသော <input> ဒြပ်စင်တစ်ခုတွင် စာလုံး 8 လုံး သို့မဟုတ် ထို့ထက်ပို၍ပါဝင်ရမည်-

<form action="/action_page.php">
  <label for="pwd">Password:</label>
  <input type="password" id="pwd" name="pwd"
  pattern=".{8,}" title="Eight or more characters">
  <input type="submit">
</form>

ဥပမာ

type="password" ပါရှိသော <input> element တစ်ခုတွင် အနည်းဆုံး နံပါတ်တစ်ခုနှင့် စာလုံးကြီး တစ်လုံးနှင့် စာလုံးအသေး တစ်လုံးနှင့် စာလုံးကြီး 8 လုံး သို့မဟုတ် ထို့ထက်ပို၍ ပါဝင်ရပါမည်-

<form action="/action_page.php">
  <label for="pwd">Password:</label>
  <input type="password" id="pwd" name="pwd"
  pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
  title="Must contain at least one  number and one uppercase and lowercase letter, and at least 8 or more characters">
  <input type="submit">
</form>

ဥပမာ

type="email" ပါရှိသော <input> ဒြပ်စင်တစ်ခုသည် အောက်ပါအစီအစဥ်အတိုင်း ဖြစ်ရမည်- အက္ခရာ @ စာလုံးများဒိုမိန်း (အက္ခရာများ @ သင်္ကေတ၊ နောက်တွင် နောက်ထပ် အက္ခရာများ ၊ ထို့နောက် "."

"နောက်။" ဆိုင်းဘုတ်၊ a မှ z အနည်းဆုံး စာလုံး 2 လုံးထည့်ပါ-

<form action="/action_page.php">
  <label for="email">Email:</label>
  <input type="email" id="email" name="email"
  pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$">
  <input type="submit">
</form>

ဥပမာ

အောက်ပါဇာတ်ကောင်များ မပါဝင်နိုင်သော type="search" ပါရှိသော <input> ဒြပ်စင်တစ်ခု- ' သို့မဟုတ် "

<form action="/action_page.php">
  <label for="search">Search:</label>
  <input type="search" id="search" name="search"
  pattern="[^'\x22]+" title="Invalid input">
  <input type="submit">
</form>

ဥပမာ

http:// သို့မဟုတ် https:// ဖြင့် အစပြုရမည့် type="url" ပါရှိသော <input> ဒြပ်စင်တစ်ခု၊

<form action="/action_page.php">
  <label for="website">Homepage:</label>
  <input type="url" id="website" name="website"
  pattern="https?://.+" title="Include http://">
  <input type="submit">
</form>

❮ HTML <input> tag