Hi all! I would like to know how I can redirect to an external url automatically once I submit a public form. The only determining factor would be a Toggle type field and depending on the answer it would redirect me or not.
My code so far is like this:
fd.saved(function (result) {
if (fd.field('Toggle1').value == true {
window.location = 'Form - Tally ';
}
});
Excuse me, the writing, my native language is Spanish and I am translating as I can.
Thanks a lot!!!
Margo
(Margo)
December 29, 2021, 12:50pm
2
Hello @belen_costantin ,
You can't get field values inside fd.saved() event. If you want to redirect user to the specific page depends on a field value, use this code:
fd.rendered(function() {
fd.field('Toggle1').$on('change', function(value){
if (value == true) {
fd.saved(function (){
window.location.href = 'Page_URL';
});
}
else {
fd.saved(function (){
window.location.href = 'Page_URL';
});
}
});
});
1 Like
thank you!!!! it worked perfectly.