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

Data in fields are not appeared in popup


Hello ,

Metronic Vue demo 8
when I want add customer the popup opening and data in some fields are existing , when I click discard the data clear from fields , the issue here when I click The sign of the exit popup and click add customer again , The data that appeared in the popup when adding a customer does not appear again .

this is the link :
https://preview.keenthemes.com/metronic8/vue/demo8/?_ga=2.71315155.1104186020.1694596631-1780376720.1674214128#/apps/customers/getting-started

Metronic
Vue demo 8 version 8.1.6
node v18.14.1
npm 9.6.0


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 (1)


Hi,

If you don't refresh the page, the data you've filled will remain in your input fields. To ensure the form always starts with the same values when a user opens the modal, you can reset the form data within the Bootstrap show.bs.modal event.

Here is an example:

const initData = {
name: "Sean Bean",
email: "sean@dellito.com",
description: "",
addressLine: "101, Collins Street",
addressLine2: "",
town: "Melbourne",
state: "Victoria",
postCode: "3000",
country: "US",
};
const formData = ref(initData);


onMounted(() => {
addCustomerModalRef.value?.addEventListener("show.bs.modal", function () {
formData.value = { ...initData };
});
});


Regards,
Lauris Stepanovs,
Keenthemes Support Team


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  :(