I am new to modx, but not coding. I need to change the email TO field generated by an eForm snippet, by switching it within javascript, based upon choices the user makes in SELECT drop downs. The previous developer had done a horrible, non-indexed, inflexible method in the snippet, whcih has to be completely reworked for a larger number of email addresses and areas/region that they pertain to.
Is it possible? If so, does anybody have any pointers? Can I dynamically fill a hidden input field or something?
Thanks for the reply, but I am using a combination, so the spammers are foiled. I set a new hidden input with the email username using javascript. The domain is common to all of them, so I add that in the php snippet.
What I am now having difficulty with is getting the email address that is newly built back into the eForm &To field - it has ignored everything so far.
How should I format a PHP script response that will change the &To field? I don't want a list of email addresses in the '[!eForm? &to ' field to choose from with mailselector, I want to write the &to address on the fly.
Yeh, eventually I gathered that. So I use another PHP script to process onbeforesendmail, build the data fro$fields, and phpmail it off...making the eform just do the ux.