Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- Include our widget script//-->
<script id="pigeon-wjs" src="https://digitalpigeon.com/assets/js/widgets.js"></script>

<form class="pure-form pure-form-aligned" method="post" action="#" name="competition-upload">
  <fieldset id="initial-fields">
    <div class="pure-g">
      <div class="pure-u-2-3">

        <div class="pure-control-group">
          <label for="name">Your Name</label>
          <input id="name" type="text" required value="Joe Submitter">
        </div>

        <div class="pure-control-group">
          <label for="email">Email Address</label>
          <input id="email" type="email" required value="joe@indiefilmmaker.co">
        </div>

        <div class="pure-control-group">
          <label for="title">Film Title</label>
          <input id="title" type="text" required value="The Pigeon Diaries">
        </div>

        <div class="pure-control-group">
          <label for="director">Director's name</label>
          <input id="director" type="text" required value="Jane Director">
        </div>

      </div>
      <div class="pure-u-1-3">
        <div>

          <label>Genre</label>

          <label for="doco" class="pure-radio">
            <input id="doco" type="radio" name="genre" value="Documentary" checked>
            Documentary
          </label>

          <label for="animation" class="pure-radio">
            <input id="animation" type="radio" name="Animation" value="option2">
            Animation
          </label>

          <label for="live-action" class="pure-radio">
            <input id="live-action" type="radio" name="genre" value="Live Action">
            Live Action
          </label>

          <label for="experimental" class="pure-radio">
            <input id="experimental" type="radio" name="genre" value="Experimental">
            Experimental
          </label>

          <label for="other" class="pure-radio">
            <input id="other" type="radio" name="genre" value="Other">
            Other
          </label>

        </div>
      </div>
      <div class="pure-controls" id="submit-controls">
        <button type="button" id="initial-field-submit" class="pure-button pure-button-primary" onclick="continueToUpload()">Continue</button>
      </div>
    </div>
  </fieldset>

  <fieldset id="uploader"><!-- Widget will get inserted here //--></fieldset>
</form>
              
            
!

CSS

              
                body {
  background-color: #eee;
}

form {
  margin: 10px;
}

#uploader:empty {
  display: none;
}

#uploader {
  background-color: #fcfafa;
  margin: 0px 10px;
  padding: 10px;
  border: 1px solid #ccc !important;
  box-shadow: inset 0 1px 3px #ddd;
  border-radius: 4px;
}

label:not(.pure-radio) {
  font-weight: bold;
}

input:disabled {
  background-color: #eee;
}
              
            
!

JS

              
                //We've added a click trigger to the 'Continue' button
// onclick="continueToUpload()"
//This function will: 
//1. validate the form
//2. Gather field values
//3. Format additional information to a 'message' string
//4. Initialise the widget with the form values

function continueToUpload() {
  //1. Let's make sure the form is valid before continuing
  if (!document.forms["competition-upload"].reportValidity()) return;

  //If the form is valid then let's disable the fields for the next step
  document
    .getElementById("initial-fields")
    .setAttribute("disabled", "disabled");
  //Hide the 'Continue' button
  document.getElementById("submit-controls").style.display = "none";

  //2. We'll collect all the field values
  var name = document.getElementById("name").value;
  var email = document.getElementById("email").value;
  var title = document.getElementById("title").value;
  var director = document.getElementById("director").value;
  var genre = document.querySelector('input[name="genre"]:checked').value;

  //3. We'll put the Director and Genre information together to go into the message field
  var message = "Director: " + director + "\n" + "Genre: " + genre;

  //4. Now we can initialise the widget with the pre-populated fields
  //Since we have all the information we need it will show as a simple file chooser.
  //The code below is modified from the Avanced Snippet in the Widget Editor.
  DigitalPigeon.init(
    document.getElementById("uploader"), 
    {
      url:
        "https://digitalpigeon.com/rcv/widget?aid=313b08b0-4608-11e0-b23d-00163e4f5c0b&lid=387e1d50-34a8-11e9-b1f2-062d42c19b03",
      fields: {
        name: {
          value: name //pass in the name from the form
        },
        email: {
          value: email //pass in the email from the form
        },
        summary: {
          value: title //pass in the film title from the form
        },
        message: {
          value: message //pass in the message we formatted above
        }
      },
      customize: {
        "color-scheme": "light",
        "link-color": "#0078e7",
        "background-color": "#fcfafa"
      }
    }
  );

  return false;
}


              
            
!
999px

Console