css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="row">
  <div class="form medium-6 medium-centered columns">
  
      <h1>Tip Your Winner</h1>
       <div id="instruction" class="callout primary">Pick your winner in this race and add a short tip</div>
    

    <!-- Form -->
    <div class="racecard-form-wrapper">
    <form id="racecardTip" name="racecardTip" action="" method="post"> 
      <label><b>Select A Presenter</b>
  <select name="pundit" id="pundit"><option value="Mark Walton">Mark Walton</option>
    <option value="Paddy Aspell">Paddy Aspell</option>
    <option value="Rory Delargy">Rory Delargy</option>
  </select>
</label>
        <h3 class="header">3.10 Musselburgh</h3>
      <p><b>Racing Post Verdict:</b> Very little solid form to sift through and Glimpse Of Gold will be a leading contender if able to return to the level of his Hereford third in November. Six of these make their handicap debuts and the market ought to offer a guide to what's expected. MONFASS, who wasn't disgraced in a fair Musselbugh contest a month ago, could prove the answer.</p><br>
      <ul class="menu racecard vertical no-bullet">
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/1/5/8/236851.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Tron Gate</b></div>
            <div class="subheader">J: Jake Greenall /T: Sam Thomas</div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Tron Gate" id="tronGate" required>
          </div>
        </li>
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/2/9/7/161792.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Well Joey</b></div>
            <div class="subheader">J:Adam Nicol / T: Philip Kirby<sup>60</sup> </div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Well Joey" id="wellJoey" required>
          </div>
        </li>
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/b/2/7/199772b.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Virtuose Du Gouet</b></div>
            <div class="subheader">J:Mr D H Dunsdon / T:Michael Wigham</div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Virtuose Du Gouet" id="virtuoseDuGouet" required>
          </div>
        </li>
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/8/7/5/169578.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Ruler Of The Nile</b></div>
            <div class="subheader">J:
Ciaran Gethings / T:Robert Stephens</div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Ruler of The Nile" id="rulerOfTheNile" required>
          </div>
        </li>
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/0/6/2/162260.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Recognition</b></div>
            <div class="subheader">J: Finian O'Toole / T:Barry Murtagh</div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Recognition" id="Recognition" required>
          </div>
        </li>
        <li class="row">
          <div class="small-2 columns">
            <img class="silk" src="https://images.racingpost.com/svg/8/9/1/243198.svg" width="64" height="64">
          </div>
          <div class="small-8 columns">
            <div><b>Fit for Fifty</b></div>
            <div class="subheader">J: Will Kennedy / T:Donald McCain</div>
          </div>
          <div class="small-2 columns ">
           <input class="selection" type="radio" name="horse" value="Fit for Fifty" id="fitForFifty" required>
          </div>
        </li>
      </ul>
      
      <div class="row">
        <div class="columns">
        <label>
          <b>Tip the horse in less than 140 Characters</b>
  <textarea id="tip" name="tip" placeholder="Example: Back it all the way!"></textarea>
          <p id="count"></p>

        
          <br>
          <button id="submit" name="submit" type="submit" class="submit-tip button expanded">
            Add your Tip
          </button>
          <!-- Success -->
              <div id="success" class="callout success">Your tip was posted</div>
          
        </div>
      </div>
      
    </form>
    </div>
      <!-- Form -->
  </div>
</section>
            
          
!
            
              

body{
  background-color: #e5e5e5;
}

.form {
  background-color: #fff;
}

h1 {
  margin:0.5em 0 0.25em 0;
}

.racecard {
  border-top:1px solid #e5e5e5;
  //padding-top: 0.5em;
  padding-bottom: 0.5em;
  
  li {
     padding-bottom: 0.5em;
  border-bottom: 1px solid #e5e5e5;
}
}

.error {
  background-color: desaturate(red, 50%);
  color: white;
  text-align: center;
  padding: 0.5em;
}

//header
.header {
  background-color: #000;
  color:#fff;
  padding:0.25em;
}

// CArd

.silk{
  display:block;
  margin-top: 0.25em;
}

.selection {
  margin-top: 1.25em;
  margin-bottom:0;
}

.racecard-form-wrapper {
  padding-bottom:3em;
}
            
          
!
            
              // Form as a JSON
$(document).ready(function() {
  // Hide success
  $('#success').hide();
  
    // Add a New Item
  $("#racecardTip").submit(function(event) {
      event.preventDefault();
    
    // Initialize Firebase
var config = {
  apiKey: "AIzaSyBJNIl1BI_u7gYZ9-ZziEfyIgYG5z5w_Bs",
  authDomain: "prototypes-8c972.firebaseapp.com",
  databaseURL: "https://prototypes-8c972.firebaseio.com",
  storageBucket: "prototypes-8c972.appspot.com",
  messagingSenderId: "138505801580"
};
firebase.initializeApp(config);

// New Firebase
var racecardDB = firebase.database().ref('racecard-tip');

    
    // Get the form data
    racecardDB.push({
      'pundit': $('select#pundit').val(),
      'tip': $('textarea#tip').val(),
      'horse' : $('input[name=horse]:checked', '#racecardTip').val(),
      'meeting': 'Musselburgh',
      'race': '3.10',
      'tiptime': Date.now()
    });

    console.log("sent");
    $("#success").fadeIn();
    $("#submit").fadeOut();
    racecardTip.reset();

  });

});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console