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.


                <!DOCTYPE html>
<form action="index.html" method="post" onsubmit="return validateForm()" name="myForm">
  <p><input type="text" name="fname" placeholder="Full Name"></p>
  <p><input type="text" name="email" placeholder="Email"></p>
  <p><input type="password" name="password" placeholder="Password"></p>
  <p><input type="text" name="phone" placeholder="Phone"></p>
  <p><input type="submit" value="Submit"></p>





                function validateForm() {
  var fname = document.forms["myForm"]["fname"].value;
  var email = document.forms["myForm"]["email"].value;
  var phone = document.forms["myForm"]["phone"].value;
//check if name is not alphabets
var check_alpha = /^[a-zA-Z]+$/;
if (!check_alpha.test(fname)) {
    alert('Please provide a valid name.Allowed alphabets only!');
    return false;
//check if email is not valid
var check_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (!check_email.test(email)) {
    alert('Please provide a valid email address.');
    return false;
//check if phone is not a number
var numbers = /^[-+]?[0-9]+$/;
if (!numbers.test(phone)) {
    alert('Please provide a valid phone number.Allowed numbers only!');
    return false;