Input Checkbox required Attribute

Paglalarawan at Paggamit

required Ang pagtatakda o pagbalik ng kung dapat ma-check ang check box bago i-sumite ang porma.

Ang katangian na ito ay nagpapakita ng HTML required attribute.

Para sa iba pang pagkakatuturo:

HTML Tagalog Manual:HTML <input> required Attribute

Halimbawa

Halimbawa 1

Tiyakin kung dapat ma-check ang check box bago i-sumite ang porma:

var x = document.getElementById("myCheck").required;

Subukan ang sarili

Halimbawa 2

Itago ang check box bilang mahalagang bahagi ng porma na dapat i-sumite:

document.getElementById("myCheck").required = true;

Subukan ang sarili

Gramata

I-balik ang required attribute:

checkboxObject.required

I-set ang required attribute:

checkboxObject.required = true|false

Halagang Atribute

Halaga Paglalarawan
true|false

Tinutukoy kung dapat o hindi ma-check ang check box bago i-sumite ang porma.

  • true - Bago i-sumite ang porma, dapat magpili ng check box na ito
  • false - Default. This checkbox is not a required part of the form submission.

Technical Details

Return Value: Boolean value, if the checkbox must be selected before submitting the form, it returns true, otherwise return false.

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support