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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

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.


                <h1 class="center">Form Validation</h1>
<form action = "form.html" method = "get" class="margin-left"><br/>
Name:<input type = "text" name = "fullname" value="Enter Full Name"/><br/>
Male<input type = "radio" name = "gender" value="male"/>Female<input type = "radio" name = "gender" value="female"/><br/>
Baseball <input type = "checkbox" name = "hobbies[]" value = "baseball" />  
Football <input type = "checkbox" name = "hobbies[]" value = "football" />  
Hockey <input type = "checkbox" name = "hobbies[]" value = "hockey" /><br/>
Favorite Show <select name = "show">
<option value = "">Choose Below</option>
<option value = "ATHF">Aqua Teen Hunger Force</option>
<option value = "Family Guy">Family Guy</option>
<option value = "Simpsons">Simpsons</option>
<textarea cols = "50" rows = "6" name = "comments">Enter Comments</textarea><br/>
<input type = "submit" name = "submit" value = "enter me" onclick="validateForm();" />


                .margin-left {
  margin-left: 42%;

.center {
  text-align: center;


                function validateForm() {
  var name = document.getElementsByName("fullname");
  var gender = document.getElementsByName("gender");
  var hobbies = document.getElementsByName("hobies[]");
  var show = document.getElementsByName("show");
  var comments = document.getElementsByName("comments");
  // name is not blank
  if (name == "") {
    alert("Please enter your full name in the Name field.");