Set Value of a field and then Save on a public form

I would like to set the value of a field before saving (submitting) the public form. I'm trying to include the following code on the "beforeSave" function but it is not working. Please advise.

fd.beforeSave(function(data) {

fd.field('ePassColorWF').value = 'green';

Thanks,

Alberto

Dear @adasilva,
One way to do it would be to modify the click property of the Submit button, to insert code before save:

1 Like