Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Textarea Validation


I want to validate textarea but when I use it, an error appears and I can't find the problem:
plugins.bundle.js:26270 Uncaught TypeError: Cannot read properties of null (reading 'classList')

the javascript:
validator = FormValidation.formValidation(
form,
{
fields: {
'target_details_1': {
validators: {
notEmpty: {
message: 'Textarea input is required'
}
}
},
},
// fields: applyValidationToInputs(form), // Dynamically add fields validation
plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap5({
rowSelector: '.fv-row',
eleInvalidClass: '',
eleValidClass: ''
})
}
}
);

the HTML:
<!--begin::Input group-->
<div class="d-flex flex-column mb-8">
<label class="fs-6 fw-semibold mb-2">Target Details</label>
<textarea class="form-control form-control-solid" rows="3" name="target_details_1" placeholder="Type Target Details" required></textarea>
</div>
<!--end::Input group-->


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


@sprunki phase 3, Can you give me an update on the current situation?



Hi,

Please make sure to have fv-row class on the input field wrapper elements. This class is used by the Form Validation plugin to access the fields to validate.
For more info please check Form Validation Guide.

Regards,
Sean


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(