HTML ပုံစံ Attribute
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ရည်ညွှန်းချက်သည် ဒြပ်စင် ၏ တန်ဖိုးကို စစ်ဆေး pattern
ထားသည့် ပုံမှန်ဖော်ပြချက်တစ်ခုကို သတ်မှတ် ပေးသည်။
<input>
မှတ်ချက်- ရည်ညွှန်းချက်သည် အောက်ပါ pattern
ထည့်သွင်းမှုအမျိုးအစားများနှင့် အလုပ်လုပ်သည်- စာသား၊ ရက်စွဲ၊ ရှာဖွေမှု၊ url၊ ဖုန်း၊ အီးမေးလ်၊ နှင့် စကားဝှက်။
အကြံပြုချက်-title
အသုံးပြုသူ ကို ကူညီရန် ပုံစံကို ဖော်ပြရန် ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းကို အသုံးပြုပါ။
အကြံပြုချက်- ကျွန်ုပ်တို့၏ JavaScript သင်ခန်းစာတွင် ပုံမှန်အသုံးအနှုန်းများ အကြောင်း ပိုမိုလေ့လာပါ ။
တွေပေါ့။
ရည်ညွှန်းချက်ကို အောက်ပါ pattern
ဒြပ်စင်ပေါ်တွင် အသုံးပြုနိုင်သည်။
ဒြပ် | ဂုဏ်ရည် |
---|---|
<input> | ပုံစံ |
ဥပမာများ
ထည့်သွင်းဥပမာ
စာလုံးသုံးလုံးသာပါဝင်နိုင်သော ထည့်သွင်းအကွက်ပါရှိသော HTML ဖောင်ပုံစံတစ်ခု (နံပါတ်များ သို့မဟုတ် အထူးအက္ခရာများမပါ)။
<form action="/action_page.php">
Country code: <input type="text" name="country_code"
pattern="[A-Za-z]{3}" title="Three letter country code">
<input type="submit">
</form>
စကားဝှက်ဥပမာ
type="password" ပါရှိသော <input> ဒြပ်စင်တစ်ခုတွင် စာလုံး 6 လုံး သို့မဟုတ် ထို့ထက်ပို၍ပါဝင်ရမည်-
<form action="/action_page.php">
Password: <input type="password" name="pw" pattern=".{6,}" title="Six or more characters">
<input type="submit">
</form>
စကားဝှက်ဥပမာ
type="password" ပါရှိသော <input> element တစ်ခုတွင် အနည်းဆုံး နံပါတ်တစ်ခုနှင့် စာလုံးကြီး တစ်လုံးနှင့် စာလုံးအသေး တစ်လုံးနှင့် စာလုံးကြီး 8 လုံး သို့မဟုတ် ထို့ထက်ပို၍ ပါဝင်ရပါမည်-
<form action="/action_page.php">
Password: <input type="password" name="pw" 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>
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် attribute ကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးပါသည်။
Attribute | |||||
---|---|---|---|---|---|
pattern | 5.0 | 10.0 | 4.0 | Not supported | 9.6 |