Open MartinsOsawe opened 2 years ago
Hello!
One possible solution:
Backend TypoScript setup:
plugin.tx_powermail {
settings {
setup {
misc {
## Enable ajaxSubmit to get redirect url via data.form.additionalAttributes.data-powermail-ajax-uri
ajaxSubmit = 1
}
finishers {
## Disable RedirectFinisher
100 >
}
}
}
}
Frontend:
export default {
// [...]
computed: {
redirect() {
return this.data.form.additionalAttributes
&& this.data.form.additionalAttributes['data-powermail-ajax-uri']
? this.data.form.additionalAttributes['data-powermail-ajax-uri']
: false
}
},
// [...]
methods: {
onSubmit() {
// Do your validation stuff ...
apiService.postFormdata(this.action, formData, this.$typo3.options.api.baseURL)
.then(response => {
if (this.redirect) {
this.$router.push({
path: this.redirect
})
} else {
// Show a message!
}
})
.catch((error) => {
console.error("Error", error);
});
}
},
// [...]
};
@MartinsOsawe, I think this has been resolved with #26, no?
Hello thanks for this awesome extension :)
When i set a redirection page link for the submit page, i don't get any information about this in the JSON. Is it possible to set this?
Thank you for your help