We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38958
    • 3 Posts
    Hi All,

    I have designed a site that uses 'ditto' to show a Product Catalog.
    This is the hierarchy:
    Catalog1
    >Product1
    >Product2
    Catalog2
    >Product1

    And so forth.

    Each individual Product has it's own page. Each product has a 'Request a Quotation' button that opens up, essentially a contact form.
    I need to find a way to auto populate the form with a Product Name.
    Basically so that the website owners know which product a quote is being requested for!


    Hope this makes sense!!

    Thanks
    Garth

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

      • 13226
      • 953 Posts
      Why dont you leave the form on each product page and use "eForm" to create the form using hidden fields for the information that you require

      Possibly something like this (eform tags have been left out on purpose):

      <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="TEST" />
        <input type="hidden" name="product_name" value="[*pagetitle*]" />
        <input type="hidden" name="product_id" value="[*id*]" />
        <input type="hidden" name="product_url" value="[(site_url)][~[*id*]~]" />
        <label for="name">Your Name:
          <input type="text" name="name" id="name" />
        </label>
        <label for="email">Email:
          <input type="email" name="email" id="email" />
        </label>
        <label for="telephone">Telephone:
          <input type="text" name="telephone" id="telephone" />
        </label>
        <textarea name="message" id="message" cols="100" rows="10"></textarea>
        <input type="submit" name="submit" id="submit" value="Request a Quotation" />
      </form>
      


      And the report would be something like:

      <table cellpadding="0" cellspacing="0">
        <tr>
          <td><strong>Product of Interest:</strong> [+product_name+]</td>
        </tr>
        <tr>
          <td><strong>Product ID:</strong> [+product_id+]</td>
        </tr>
        <tr>
          <td><strong>Product Webpage:</strong> [+product_url+]</td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td><strong>Name:</strong> [+name+]</td>
        </tr>
        <tr>
          <td><strong>Telephone Number:</strong> [+telephone+]</td>
        </tr>
        <tr>
          <td><strong>Email Address:</strong> [+email+]</td>
        </tr>
        <tr>
          <td>[+message+]</td>
        </tr>
      </table>
      




      You could also take a look here: Split eForm in to multiple pages / forms

      With that you can create a 3 step form and dynamically fill in the form with all the information needed to send a request:

      Example:

      Form 1 = Step 1

      Only has a button with "Request a Quotation"
      All other required fields are "Hidden" - for example the alias, ID, pagetitle, description etc.

      <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="TEST" />
        <input type="hidden" name="quote_step" value="1" />
        <input type="hidden" name="product_name" value="[*pagetitle*]" />
        <input type="hidden" name="product_id" value="[*id*]" />
        <input type="hidden" name="product_url" value="[(site_url)][~[*id*]~]" />
        <input type="submit" name="submit" id="submit" value="Request a Quotation" />
      </form>
      


      Form 2 = Step 2

      <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="TEST" />
        <input type="hidden" name="quote_step" value="2" />
        <label for="name">Your Name:
          <input type="text" name="name" id="name" />
        </label>
        <label for="email">Email:
          <input type="email" name="email" id="email" />
        </label>
        <label for="telephone">Telephone:
          <input type="text" name="telephone" id="telephone" />
        </label>
        <textarea name="message" id="message" cols="100" rows="10"></textarea>
        <input type="submit" name="submit" id="submit" value="Next Step >" />
      </form>
      


      Form 3 = Step 3

      <p><strong>You provided the following information</strong></p>
      <table cellpadding="0" cellspacing="0">
        <tr>
          <td><strong>Your Name:</strong> [+name+]</td>
        </tr>
        <tr>
          <td><strong>Your Telephone Number:</strong> [+telephone+]</td>
        </tr>
        <tr>
          <td><strong>Your Email Address:</strong> [+email+]</td>
        </tr>
        <tr>
          <td><strong>Product of Interest:</strong> [+product_name+]</td>
        </tr>
        <tr>
          <td>[+message+]</td>
        </tr>
      </table>
      <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="TEST" />
        <input type="hidden" name="quote_step" value="3" />
        <input type="submit" name="submit" id="submit" value="Confirm Your Request" />
      </form>
      
        • 38958
        • 3 Posts
        Hello,

        Thanks for your help! I am getting the following error:
        Some errors were detected in your form:
        [undefined] » Tampering attempt detected!
        [undefined] » Tampering attempt detected!
        [undefined] » Tampering attempt detected!

        Any Ideas?
          • 13226
          • 953 Posts
          Your hidden fields need to have an eform call of "::0::" to avoid it being validated by eForm.

          example:
          <input type="hidden" name="product_name" value="[*pagetitle*]" eform="::0::" />
          


          For more information check out the eForm Wiki on "Hidden fields, select boxes, radio options and checkbox fields"
            • 13226
            • 953 Posts
            @garthwest

            Has this problem now been dealt with ? If so, any chance of marking it as solved.

            Cheers
            • discuss.answer
              • 38958
              • 3 Posts
              My apologies,

              Yes it has been resolved, thank you for your assistance

              Cheers