HTML DOM Form Object
Form Object
Form object သည် HTML <form> element ကို ကိုယ်စားပြုသည်။
Form Object ကို ဝင်သုံးပါ။
getElementById() ကို အသုံးပြု၍ <form> ဒြပ်စင်တစ်ခုကို သင်ဝင်ရောက်နိုင်သည်။
ဥပမာ
var x = document.getElementById("myForm");
အကြံပြုချက်- ဖောင် များစုစည်းမှု ကို အသုံးပြုခြင်းဖြင့် <form> ဒြပ်စင်တစ်ခုကိုလည်း သင်ဝင်ရောက်နိုင်သည် ။
Form Object တစ်ခုဖန်တီးပါ။
document.createElement() နည်းလမ်းကို အသုံးပြု၍ <form> element တစ်ခုကို ဖန်တီးနိုင်သည်-
ဥပမာ
var x = document.createElement("FORM");
အရာဝတ္ထု စုစည်းမှုပုံစံ
Collection | Description |
---|---|
elements | Returns a collection of all elements in a form |
Form Object Properties များ
Property | Description |
---|---|
acceptCharset | Sets or returns the value of the accept-charset attribute in a form |
action | Sets or returns the value of the action attribute in a form |
autocomplete | Sets or returns the value of the autocomplete attribute in a form |
encoding | Alias of enctype |
enctype | Sets or returns the value of the enctype attribute in a form |
length | Returns the number of elements in a form |
method | Sets or returns the value of the method attribute in a form |
name | Sets or returns the value of the name attribute in a form |
noValidate | Sets or returns whether the form-data should be validated or not, on submission |
target | Sets or returns the value of the target attribute in a form |
ဖောင် Object Methods
Method | Description |
---|---|
reset() | Resets a form |
submit() | Submits a form |
စံသတ်မှတ်ချက်များနှင့် အစီအစဉ်များ
Form object သည် စံ ဂုဏ်သတ္တိများ နှင့် ဖြစ်ရပ်များ ကို ပံ့ပိုး ပေးပါသည်။
ဆက်စပ်စာမျက်နှာများ
HTML သင်ခန်းစာ- HTML ပုံစံများ
JavaScript သင်ခန်းစာ- JS Forms/Validation
HTML ရည်ညွှန်း- HTML <form> တဂ်