On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • 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?
    • Quote from: onyx_nz at Feb 18, 2014, 09:50 AM
      Is it possible? If so, does anybody have any pointers? Can I dynamically fill a hidden input field or something?

      Don't do it client-side because you're exposing email addresses to spammers, take a look at the &mailselector parameter:
      http://www.partout.info/assets/snippets/eform/docs/eform.htm#params
      • 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.
        • Quote from: onyx_nz at Feb 20, 2014, 03:26 AM
          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.

          I don't think this is supported in ther current version of eForm snippet.
          • 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.