You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is a pretty common use case to have a button that you want to trigger a form submission where the button is outside the form component. You used to be able to do this quite easily using PrimeVue 3 and Vuelidate. It's especially annoying when using a Dialog for example, where the buttons are typically in their own footer template and the body of the modal contains the form.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think it is a pretty common use case to have a button that you want to trigger a form submission where the button is outside the form component. You used to be able to do this quite easily using PrimeVue 3 and Vuelidate. It's especially annoying when using a Dialog for example, where the buttons are typically in their own footer template and the body of the modal contains the form.
PrimeVue 3 sample
`const submitted = ref(false);
const rules = {
currentPassword: { required },
newPassword: { required },
confirmPassword: { required }
};
const v$ = useVuelidate(rules, password);
const save = async () => {
const isFormValid = await v$.value.$validate();
submitted.value = true;
if (!isFormValid) {
return;
}
await userAccountStore.changePassword(password.value);
}`
Beta Was this translation helpful? Give feedback.
All reactions