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

ejaz's avatar
Level 1

Vee-Vlidation initial values not getting update while i am trying to update the record.

Hello, I am using vee-validation libraray and yep form in vue 3. in table my all data is showing and when i clicking on a record for edit it is papulating in the table and when i close the form and try to update next record then the form values not getting change. but in console the formValues are getting changed. here is my code.

          <Drawer
            v-model:open="open"
            :title="editing ? 'Edit Category' : 'Create Category'"
            placement="right"
            :maskClosable="false"
            @after-open-change="afterOpenChange"
          >
            <Form
              @onSubmit="createCategory"
              :validation-schema="schema"
              v-slot="{ errors }"
              ref="form"
              :initial-values="formValues"
            >
              <div class="form-group">
                <label for="categoryName">Category Name</label>
                <Field
                  :class="{ 'is-invalid': errors.name }"
                  type="text"
                  name="name"
                  class="form-control"
                  id="categoryName"
                />

                <small id="emailHelp" class="invalid-feedback">{{
                  errors.name
                }}</small>
              </div>

              <button type="submit" class="btn btn-primary">Save</button>
            </Form>
          </Drawer>
         
0 likes
0 replies

Please or to participate in this conversation.