Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tayyabshahzad1's avatar

I am using From Validation Provided by Template

this is my input field

<input type="text" name="floor_name[]" required=""> Here is some Javascript From Template to validate the field

  var _initValidation = function () {
             
            _validations.push(FormValidation.formValidation(
                _formEl,
                {
                    fields: {
                        name: {
                            validators: {
                                notEmpty: {
                                    message: 'Name is required'
                                }
                            }
                        },
                        tax_rate: {
                            validators: {
                                notEmpty: {
                                    message: 'Tax rate is required'
                                }
                            }
                        },
                        
                        'floor_name[]': {
                            validators: {
                                notEmpty: {
                                    message: 'Floor name is required'
                                }
                            }
                        },

Validation is working fine for the default input field. I have placed one button next to the input field when I click that button I am appending a new input field in the current div wrapper with same name but on appended div validation rules are not working.

0 likes
0 replies

Please or to participate in this conversation.