Hello,
Newbie here. I need to enable / disable the submit button when the toggle is on or off. how can i do that i the Public Forms. Please help.
Thanks in Advance.
Echo
Hello,
Newbie here. I need to enable / disable the submit button when the toggle is on or off. how can i do that i the Public Forms. Please help.
Thanks in Advance.
Echo
Hello @EchodaPogi,
You can use the code below to enable/disable field dynamically depending on toggle value. Update the code with the field internal names.
fd.rendered(function() {
function disableField() {
//if toggle is on
if (fd.field('Toggle').value == true) {
//disabled field
fd.field('Field1').disabled = true;
}
else{
//enable field
fd.field('Field1').disabled = false;
}
}
// Calling disableField when the toggle value changes
fd.field('Toggle').$on('change',disableField);
// Calling disableField on form loading
disableField();
});
Learn more in Work with web form fields in JavaScript article.
@mnikitina - thank you so much. It worked perfectly. I know i have more questions to come. Newbie on this form. But its awesome. I integrate Plumsail in our company processes and it work great. thanks again