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.

            
              <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Survey Form</title>
    <link rel="stylesheet prefetch" href="https://fonts.googleapis.com/css?family=Coda" type="text/css"/>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script 
  src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  </head>
  <body>
    <main id="main">
      <header>
        <h1 id="title">11-16 Summer Break Survey Form</h1>
        <hr>
        <p id="description">Keeping your kids active during the school Summer break</p>
      </header>
<div id="container">
  <form id="survey-form" action="#" name="surveyForm" onsubmit="return validateName()" method="post">
          <div class="row">
            <div class="col-25">
          <label for="name-label" id="name-label"><em>First Name: *</em></label> <!--validate no numbersand length-->
            </div>
           <div class="col-75">
            <input type="text" id="name" name="firstname"
 placeholder="enter first mame.." pattern="[A-Za-z]{1,25}" required>
           </div>
          </div>
        <div class="row">
          <div class="col-25">
        <label for="lname-label" id="lname-label"><em>Last Name: *</em></label> <!--validate no numbers and length-->
            </div>
           <div class="col-75">
          <input type="text" id="lname" name="lastname" placeholder="enter last mame.." pattern="[A-Za-z]{1,15}"required>
      </div>
     </div>
       <div class="row">
         <div class="col-25">
          <label for="number-label" id="number-label"><em>Age: *</em></label>
         </div><!--validate minmax and numbers only-->
         <div class="col-75">
            <input type="number" id="number" name="age" placeholder="select age" min="11" max="16" required>
         </div>
        </div>
       <div class="row">
        <div class="col-25">
          <label for="email-label" id="email-label"><em>Email: *</em></label>
         </div>
        <div class="col-75"><!--validate correct format-->
            <input type="email" id="email" name="email" placeholder="enter email" required>
       </div>
    </div>
    <div>
      <p id="required"><em> * required</em></p>
    </div>
      <p id="phone">Please enter your phone number without spaces (11-13 digits):</p>
    <div class="row">
      <div class="col-25">
        <label for="tel-label" id="tel-label"><em>Phone:</em></label>
        </div>
        <div class="col-75">
        <!--validate minmax and numbers only, option for area code '+'-->
            <input type="tel" id="tel" name="phone" placeholder="enter number" pattern='^\+?\d{11,13}' required>
        </div>
      </div>
          <fieldset type="radio-buttons" id="radio-buttons">
          <p>What activities did you enjoy the most?</p>
          <p id="options"><em>choose an option from below</em>:</p>
         <ul style="list-style: none;">
          <li class="radio">
          <label for="indoor-activities">Indoor-activities
            <input name="indoor activities-outdoor activities" value="1" type="radio"></label><br>
            </li>
          <li class="radio">
          <label for="outdoor-activities">Outdoor-activities
            <input name="indoor activities-outdoor activities" value="2" type="radio"></label>
            </li>
             <div>
        </fieldset>
        <div><br>
          <p>What activities would you like to see added next Summer?<p/>
          <p id="interests"><strong>Interests</strong>: <em>choose all those that apply</em>.</p> 
        </div>
            <label class="container">Sking
  <input type="checkbox" value="interests">
  <span class="checkmark"></span>
</label>
          <label class="container">Absailing
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Swimming
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Horseriding
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Hairdressing
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Singing
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Judo
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
          <label class="container">Poetry Challenge
            <input type="checkbox" value="interests">
            <span class="checkmark"></span>
            </label>
        
          <p>Select an activity time you prefer for each choice above respectively:</p><!--morning or afternoon-->
   <div class="form-group">
     <label for="preftimes" id="preftimes"><em>Days and Times</em>:</label>
    <select id="form-control" name="preftimes" size="3" multiple>
              <option value="Mon am">Mon am</option>
              <option value="Mon pm">Mon pm</option>
              <option value="Tue am">Tue am</option>
              <option value="Tue pm">Tue pm</option>
              <option value="Weds am">Weds am</option>
              <option value="Weds pm">Weds pm</option>
              <option value="Thurs am">Thurs am</option>
              <option value="Thurs pm">Thurs pm</option>
              <option value="Fri am">Fri am</option>
              <option value="Fri pm">Fri pm</option>
    </select>
        <p id="days"><em>(Hold down the Ctrl (windows) / Command (Mac) key to select multiple options)</em>.</p><br>
    </div>
    <div class="dropdown-menu">
      <label for="lunch"><em>Lunch Options</em>:</label>
    <p id="lunch">What lunches did your prefer?</p>
      <p id="diet"><em>(Select a dietary lunch option from the dropdown menu below)</em>.</p><br><!--vegitarian, vegan, meat -->
      <select id="dropdown" name="lunch">
        <option disabled choice value>Choose an option</option>
          <option value="meat & veg">Meat and Veg</option>
            <option value="vegetarian">Vegitarian</option>
              <option value="halal">Halal</option>
                <option value="vegan">Vegan</option>
      </select>
    </div><br><br>
        <div class="row">
          <div class="col-25">
            <label for="comments-label"><em>Comments</em>:</label>
          </div>
            <div class="col-75">
            <!--<label for="comments-input">Comments:-->
        <textarea id="comments-label" name="comments-label" placeholder="additional info.." style="height:200px">
       </textarea>
          </div><br>
        </div>
      <p id="thanks">Thank you for completing the survey.  Your views will help us to improve our service for next year.</p>
     <div>
      <button id="submit" type="submit">Submit</button>
    </div>
  </form>
 </div>
</main>
    <script src="js/index.js"></script>
    <footer class="copyright">
      <p>Summer Holiday Actvities, Copyright &copy; 2018</p>
    </footer>
 </body>
</html>

            
          
!
            
              html,
body {
  font-family: 'Open Sans', Sans-Serif;
  color: #2f4f4f;
  background: LightGray;
  font-size: 100%;
}
#main {
    padding-top: 40px;
    padding-bottom: 50px;
    width: 60%;
    margin: auto;
    background: #ffffff;
    padding-left:50px;
    padding-right:50px;
}
#title {
  padding-top: 15px;
  padding-bottom: 15px;
  padding-right: 10px;
  padding-left: 10px;
  font-size: 300%;
  color: #fff;
  background:#0000ff;
  font-weight: 100;
  text-align: center;
  text-transform: uppercase;
}
#description {
  font-size: 200%;
  color: #0000ff;
  text-align: center;
  font-weight: 100;
  text-transform: uppercase;
}
/* Style input types, and textarea*/
input[type=text],[type=email],[type=number],[type=radio-buttons],[type=tel], textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
  resize: vertical;
}
/*All labels*/
label {
  padding: 10px 10px 10px 0;
  display: inline-block;
  color: blue;
}
/*form*/
#container {
  border-radius: 5px;
    background-color: lightblue;
    padding: 25px;
}
.col-25 {
    float: left;
    width: 25%;
    margin-top: 7px;
}
.col-75 {
    float: left;
    width: 75%;
    margin-top: 7px;
}
.row:after {
    content: "";
    display: table;
    clear: both;
}
/*age*/
/*#number, input{
  width: 10.7rem;
  height: 1.5rem;
  margin: 10px 0 0 0;*/
#required {
  font-size: 80%;
  color: blue;
  margin-top: -10px;
}
label, input  {
  margin: 5px 0 15px 0;
}
.radio label input {
  display: flex;
  flex-direction: row;
  cursor: pointer;
  position: relative;
  padding-left: 25px;
  padding-top: 10px;
  font-size: 17px;
  margin-left: -38px;
  margin-top: -20px;
  margin-bottom: -25px;
  -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/*fieldset styling*/
#radio-buttons {
  border: 1px solid slateGray;
  border-radius: 5px;
  padding-bottom: 1px;
  width: 100%;
  resize: vertical;
}
/*checkbox styling*/
.container {
    display: block;
    position: relative;
    padding-left: 45px;
    padding-top: 2px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 17px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
}
.container:hover input ~ .checkmark {
    background-color: #ccc;
}
.container input:checked ~ .checkmark {
    background-color: #2196F3;
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.container input:checked ~ .checkmark:after {
    display: block;
}
.container .checkmark:after {
    left: 9px;
    top: 5px;
    width: 2px;
    height: 7px;
    border: solid white;
    border-width: 0 3px 3px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}
/*days and times*/
.form-group  {
  display: flex;
  margin-left: -2px;
  margin-top: 30px;
  margin-bottom: -10px;
  position: block;
}
/*prefered times*/
#form-control {
  width: 10%;
  text-align: left;
  padding-left: 5px;
  padding-right: 20px;
  margin-bottom: 30px;
  margin-right: 10px;
  cursor: pointer;
}
/*select multiple options dsys and times*/
#days {
  font-size: 80%;
  color: #000;
  margin-right: 60px;
}
/*paragraph*/
#lunch {
  margin-top: -5px;
}
/*select dietary option*/
#diet {
    font-size: 80%;
  color: #000;
  }
.dropdown-menu label {
  margin-left: -2px
}
/*comments box*/
#comments-label {
  font-size: 100%;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  cursor: pointer;
}
#comments-label  {
  margin-left: -2px;
}
#thanks {
  color: #000;
}
#submit:hover {
  cursor: pointer;
  color: blue;
  font-weight: 100;
  font-size: 15px;
  /*border: none;*/
  border-radius: 4px;
  background: yellow;
  padding: 8px 16px;
}
/*footer*/
.copyright {
    margin-top: 70px;
    background: #0000ff;
    padding-top: 15px;
    padding-bottom: 15px;
    color: #fff;
    font-size: 100%;
    text-align: center;
}
@media screen and (max-width: 768px) { /*mobile phone mode*/
#main {
    width: 90%;
    margin: auto;
}
  #title {
      font-size: 200%;
}
  #description {
      font-size: 100%;
}
  .col-25, .col-75, input[type=submit] {
        width: 100%;
        margin-top: 0;
  }
  #form-control {
  width: 80%;
    padding-right: 5px;
  }
.copyright {
    font-size: 70%;
    }
}

            
          
!
            
              function validateName() {
  var x = document.forms["surveyForm"]["name"].value;
  if (x == "") {
      alert("Please enter your first name");
      return false;
  }
}
            
          
!
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