Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

About change model id


About model id

Hi everyone,
I changed the model id, but the cancel and submit button alert does not work, so
Are there changes in any script file that must be done?
Regards,,


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)


Hi,

Thank you for reaching out to us.

Could you specify your Metronic version?

Also, please specify the example you are using and which exact ID you have updated.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hello,
Thank you for your response,
the version is metronic_v5.5.5
I used a card from Metronic and the card ID is
<form class="form" >

I need to change the ID but if I change the ID the model will not work correctly
Regards,



Hi,

Sorry for the late reply.

Please be aware that the most recent Metronic version is v8.1.2, and Metronic 5 does not have an Asp.Net-Core version.

Are you using your own Asp.Net-Core setup, or are you utilizing our Asp.Net-Core Starterkit in Metronic 8?

If you encountered an issue in our Starterkit, kindly provide additional details and steps to reproduce the problem so that I can assist you further.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



I use the new card form however if I change the model ID and form ID in the HTML code and also in the js file( assets/js/custom/utilities/modals/new-card.js)
then the validation form and submit and cancel button do not work? why? but if I don't change any ID it is work

Also, I used the validation from the Documentation but if (status == 'Valid'), it is always false because the status has a null value

/ Define form element
const form = document.getElementById('kt_docs_formvalidation_text');

// Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/
var validator = FormValidation.formvalidation(
form,
{
fields: {
'text_input': {
validators: {
notEmpty: {
message: 'Text input is required'
}
}
},
},

plugins: {
trigger: new FormValidation.plugins.Trigger(),
bootstrap: new FormValidation.plugins.Bootstrap5({
rowSelector: '.fv-row',
eleInvalidClass: '',
eleValidClass: ''
})
}
}
);

// Submit button handler
const submitButton = document.getElementById('kt_docs_formvalidation_text_submit');
submitButton.addEventListener('click', function (e) {
// Prevent default button action
e.preventDefault();

// Validate form before submit
if (validator) {
validator.validate().then(function (status) {
console.log('validated!');

if (status == 'Valid') {
// Show loading indication
submitButton.setAttribute('data-kt-indicator', 'on');

// Disable button to avoid multiple click
submitButton.disabled = true;

// Simulate form submission. For more info check the plugin's official documentation: https://sweetalert2.github.io/
setTimeout(function () {
// Remove loading indication
submitButton.removeAttribute('data-kt-indicator');

// Enable button
submitButton.disabled = false;

// Show popup confirmation
Swal.fire({
text: "Form has been successfully submitted!",
icon: "success",
buttonsStyling: false,
confirmButtonText: "Ok, got it!",
customClass: {
confirmButton: "btn btn-primary"
}
});

//form.submit(); // Submit form
}, 2000);
}
});
}
});

Regards,,



Hi,

Do you see any errors in your console?

Make sure you've updated all instances where the ID is referenced. You can use the global find and replace feature in your IDE to replace the ID.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(