We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27072
    • 76 Posts
    Hello all,

    I've been using the reliable eForm with Captcha and validations for our Contact Us application.

    Now, we wish to call the contact us form from different pages with the message box already pre-populated with a message that the visitor will most likely use.

    An example of this application might be calling the contact-us page from a celebrity page that is missing a photo.
    In that case, I'd like to have a preset phrase to display in the Message field: "Please publish photo for Albert Einstein."
    This is done to engage visitors in writing to us their requests more often.

    I've read the forum and conducted various tests, some of which (POST/GET) are not even secured.
    I have also tried spaceholders, systemvars.
    Unfortunately I didn't manage it even remotely.

    I ask for your help in either directing me to a working concept or point to another add-on that will do the trick.
    I prefer solutions that do not require modification of the core code.

    I also offer to pay for professional services if required.

    much appreciated,
    Shlomo Tommer

    This question has been answered by redtoad. See the first response.

      Cheers,
      Shlomo Tommer
    • discuss.answer
      • 24732 ☆ A M B ☆
      • 300 Posts
      I do this on http://www.jnmcpa.com/david-price.html and the other partner pages.

      I have the contact form going to different people its the same concept, the "set an appointment" button is this
      code:

      
       [!setPartner!]
      <p class="appt"><a href="[~97~]">Set an Appointment </a></p>


      I have a little snippet that sets a session variable from the pagetitle of the page (which is a name).
      <?php
      session_start();
      $partnerName=$modx->documentObject['pagetitle'];
      $_SESSION['partnerName']=$partnerName;
      ?>
      


      yours could set a message from a template variable, you use a session variable or cookie to give me the variable from screen to screen as the form is submitted.

      My eform call is this
      
      <p>[!eForm? &formid=`apptForm` &cc=`[email protected]` &to=`[email protected]` &tpl=`appointmentForm` &report=`appointmentReport` &sessionVars=`partnerName` &automessage=`appointmentThanks` &from=`[email protected]` &thankyou=`appointmentThanks` &vericode=`1` &subject=`Appointment Request`!]</p> 
      

      in my form and report I have the placeholder [+partnerName+]

      <p> <label accesskey="p" for="partnerName"> I'd like an appointment with:<br /><input type="text" name="partnerName" value="[+partnerName+]" eform="::0::" /></label>


      so that input box is prepopulated on the form. I hope this helps.
        ________

        Anne
        Toad-in-Chief
        Red Toad Media - Web Design, Louisville KY
        Hear me tweet: http://www.twitter.com/redtoadmedia
        "Bring on the imperialistic condiments." - Rory Gilmore
        • 27072
        • 76 Posts
        Dear Anne,

        Firstly, cheers to an excellent work on http://www.jnmcpa.com/.

        Secondly, thank you so much for showing me the path and the light at the end of it smiley
        I'll implement your clear instructions over the weekend and update you with the final outcome.

        Thirdly, thank you so very much,
        Shlomo

          Cheers,
          Shlomo Tommer