Copy link to clipboard
Copied
I'm working with a form that has fields populate based on a drop-down selection. I'm applying a script to a submit button to validate required fields, but to ignore them if they're hidden. If all of the required visible fields aren't complete the user should get an error message and then be returned to the form suppressing the email. This piece is working. But, now even after the fields have been completed, the email won't generate. Both scripts work separately. But I can't seem to get them to work together. I'm pretty new with JavaScript. Any help would be appreciated.
Copy link to clipboard
Copied
You used uppercase 'I' for loop and then used lowercase 'i' in this.getNthFieldName (i).
You are using variable if (requiredFields.length > 0) but it's not declared anywhere also in cMsg: message text.
You're using curly quotes (“ ”), JavaScript requires straight quotes (" ") for strings.
Copy link to clipboard
Copied
Thank you. So I fixed the quotes and capitalization. How would I declare it?
Copy link to clipboard
Copied
Same as emptyFields.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more