• Resolved clipper87

    (@clipper87)


    I have a contactform with some fields + a wetransfer embed snippet that basically fills an input field with a wetransfer url after uploading some file to wetransfer

    I would like to make the upload mandatory (required) so that the form cannot be submitted unless a file has been uploaded to wetransfer. (The input field needs to contain a url value)

    The snippet one has to use (see https://developers.wetransfer.com/) is this one:
    (I removed my embedkey value for security reason)

    <div data-widget-host="habitat" id="wt_embed">
      <script type="text/props">
        {
          "wtEmbedKey": "not-disclosed-for-security-reason",
          "wtEmbedOutput": ".wt_embed_output",
          "wtEmbedLanguage": "en"
        }
      </script>
    </div>
    <script async src="https://prod-embed-cdn.wetransfer.net/v1/latest.js"></script>
    <!--
      The next input element will hold the transfer link. For testing purposes, you
      could change the type attribute to "text", instead of "hidden".
    -->
    <input type="hidden" name="wt_embed_output" class="wt_embed_output" />

    The problem is that the input field is not a contactform 7 field as such and even adding the “required” attribute does not solve the issue. Adding a cf7 field with the name “wt_embed_output” does not work, neither does it work if I add the class etc.

    Any ideas ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter clipper87

    (@clipper87)

    Kudos to my son Rutger for helping me out; this is the way to implement wetransfer embed in contactform 7 (and make the upload mandatory/required):

    <div data-widget-host="habitat" id="wt_embed">
      <script type="text/props">
        {
          "wtEmbedKey": "not-disclosed-for-security-reason",
          "wtEmbedOutput": "span > .wt_embed_output",
          "wtEmbedLanguage": "nl"
        }
      </script>
    </div>
    <script async src="https://prod-embed-cdn.wetransfer.net/v1/latest.js"></script>
    
    <!--
      The next input element will hold the transfer link. For testing purposes, you
      could change the type attribute to "text", instead of "hidden".
    -->
    
    [text* wt_embed_output id:wt_embed_output class:wt_embed_output]

    Adding span > to the wtEmbedOutput key’s value did the trick!

    Thanks clipper! this helped me!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘use wetransfer embed in form’ is closed to new replies.