HTML::O...t::Form(3)
π NAME
okay so bestie, this is the HTML::O...t::Form(3) page for HTML::Object::DOM::Element::Form β the HTML Object DOM Form Class. It's a User Contributed Perl Documentation page, and it's giving very main-character form-element energy. π«Ά
π¬ SYNOPSIS
this is the whole load-up, no cap:
use HTML::Object::DOM::Element::Form;
my $form = HTML::Object::DOM::Element::Form->new ||
die( HTML::Object::DOM::Element::Form->error, "\n" );
πΈ VERSION
the version is literally:
v0.2.1
β¨ DESCRIPTION
okay so this interface represents a <form> element in the DOM. It lets you access β and in some cases modify β aspects of the form, plus get at its component elements. That's the vibe check, fr fr. π
𧬠INHERITANCE
the way that inheritance chain just keeps going? iconic. π
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Form |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
π PROPERTIES
Inherits properties from its parent HTML::Object::DOM::Element β slay.
π acceptCharset
It's a string reflecting the value of the form's accept-charset HTML attribute, and it represents the character encoding that the server accepts. β¨
Example:
<form action="/some/where" accept-charset="utf-8">
<button>Ok</button>
</form>
my $inputs = $doc->forms->[0]->acceptCharset; # utf-8
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/acceptCharset
π¦ action
A string reflecting the value of the form's action HTML attribute. It contains the URI of a program that processes the information submitted by the form. π«Ά
Example:
var $form = $doc->forms->[0];
$form->action = '/cgi-bin/publish';
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/action
πΈ autocomplete
A string β either "on" or "off" β reflecting the value of the form's autocomplete HTML attribute. It indicates whether the controls in this form can have their values automatically populated by the browser. β
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/autocomplete
π elements
Read-only. bestie, don't even try to assign to it.
A collection object holding all form controls (https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements) belonging to this form element. iykyk.
Example:
<form id="my-form">
<input type="text" name="username">
<input type="text" name="full-name">
<input type="password" name="password">
</form>
my $inputs = $doc->getElementById("my-form")->elements;
my $inputByIndex = $inputs->[0];
my $inputByName = $inputs->username;
Another example:
my $inputs = $doc->getElementById("my-form")->elements;
# Iterate over the form controls
for( my $i = 0; $i < $inputs->length; $i++ )
{
if( $inputs->[i]->nodeName == "INPUT" && $inputs->[i]->type == "text" )
{
# Update text input
$inputs->[i]->value->toLocaleUpperCase();
}
}
Another example:
my $inputs = $doc->getElementById("my-form")->elements;
# Iterate over the form controls
for( my $i = 0; $i < $inputs->length; $i++ )
{
# Disable all form controls
$inputs->[$i]->setAttribute( "disabled", "" );
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements, and StackOverflow question: https://stackoverflow.com/questions/34785743/javascript-about-form-elements
π§ encoding
A string reflecting the value of the form's enctype HTML attribute. It indicates the type of content that is used to transmit the form to the server. Only specified values can be set. The two properties are synonyms. π
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/encoding
π« length
Read-only. periodt.
A long reflecting the number of controls in the form. π₯
Example:
if( $doc->getElementById('form1')->length > 1 )
{
# more than one form control here
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/length
π method
A string reflecting the value of the form's method HTML attribute. It indicates the HTTP method used to submit the form. Only specified values can be set. no cap. β¨
Example:
$doc->forms->myform->method = 'post';
my $formElement = $doc->createElement("form"); # Create a form
$doc->body->appendChild( $formElement );
say( $formElement->method ); # 'get'
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/method
π name
A string reflecting the value of the form's name HTML attribute. It contains the name of the form. π¦
Example:
my $string = form->name;
form->name = $string;
my $form1name = $doc->getElementById('form1').name;
if ($form1name != $doc->form->form1) {
# Browser does not support this form of reference
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/name
π‘οΈ noValidate
A boolean value reflecting the value of the form's novalidate HTML attribute. It indicates whether the form should not be validated. π
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/noValidate
π― target
A URL reflecting the value of the form's target HTML attribute. It indicates where to display the results received from submitting the form. π
Example:
$myForm->target = $doc->frames->[1]->name;
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/target
π οΈ METHODS
Inherits methods from its parent HTML::Object::DOM::Element β the family tree stays iconic. π
β checkValidity
In perl, this always returns true, or whatever value you would have set.
In JavaScript environment, this returns true if the element's child controls are subject to constraint validation and satisfy those constraints. It returns false if some controls do not satisfy their constraints. It fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. It is up to the programmer to decide how to respond to false. π
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/checkValidity
π£ reportValidity
In perl, this always returns true, or whatever value you would have set.
In JavaScript environment, this returns true if the element's child controls satisfy their validation constraints. When false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. π«Ά
Example:
$doc->forms->myform->addEventListener( submit => sub
{
$doc->forms->myform->reportValidity();
}, { capture => 0 });
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/reportValidity
π requestSubmit
Requests that the form be submitted using the specified submit button object and its corresponding configuration. π
Example:
my $myForm = $doc->querySelector( 'form' );
my $submitButton = $myForm->querySelector( '#main-submit' );
if( $myForm->requestSubmit )
{
if( $submitButton )
{
$myForm->requestSubmit( $submitButton );
}
else
{
$myForm->requestSubmit();
}
}
else
{
$myForm->submit();
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit
π¨ submit
This does nothing and returns "undef" under perl environment. π
In JavaScript environment, this submits the form to the server. π₯
Example:
$doc->forms->myform->submit();
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
π AUTHOR
Jacques Deguest β jack@deguest.jp β chef's kiss. π
π¦ SEE ALSO
- Mozilla documentation:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement - Mozilla documentation on form element:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form
π COPYRIGHT & LICENSE
Copyright(c) 2021 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bestie, that's the whole page π β it's from perl v5.42.2, dated 2026-02-15, and it's the manual for HTML::O...t::Form(3). mwah, go slay your form handling β¨π
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms