ridwanskaterock / cicool

Cicool is a multifunctional application that is used to facilitate your work in creating a system, CMS, E-Comerce and others
20 stars 13 forks source link

function parseErrorField() not work for multiple select #549

Open vin111 opened 1 year ago

vin111 commented 1 year ago

Hi I have validation problem on select multiple fields

<div class="form-group group-idTestate">
                          <label for="idTestate" class="col-sm-1 control-label">Testate <i class="required">*</i>
                          </label>
                          <div class="col-sm-4">
                              <select class="form-control chosen chosen-select-deselect" name="idTestate[]"
                                      id="idTestate" data-placeholder="Seleziona Testate" multiple>
                                  <option value=""></option>

return this error

jquery-3.6.0.min.js:2 Uncaught Error: Syntax error, unrecognized expression: form #idTestate[]
    at parseErrorField (custom.js:100:5)

custom.js
function parseErrorField(errors) {
  **$.each(errors, function (index, val) {**

Probably why $.each(errors, function (index, val) { it expects a value as a key instead it gets an array how can i fix the problem Thank you