Pen Settings



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


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


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.


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>
<html lang="en">
		<meta charset="UTF-8" />
		<title>Vue.js Form</title>
		<div id="app" class="container-fluid">
      <h1>Vue.js Form</h1>
        <div class="form-container" v-if="!formSuccess">
          <div class="form-row">
            <div class="form-group col-6">
              <input type="text" class="form-control" placeholder="First name" v-model="firstName">
            <div class="form-group col-6">
              <input type="text" class="form-control" placeholder="Last name" v-model="lastName">
            <div class="form-group col-12">
              <input type="text" class="form-control" placeholder="address" v-model="address">
            <div class="form-group col-md-6">
              <input type="text" class="form-control" placeholder="City" v-model="city">
            <div class="form-group col-md-4">
              <select id="state" class="form-control" v-model="state">
                <option selected>State</option>
                <option>State 1</option>
                <option>State 2</option>
                <option>State 3</option>
                <option>State 4</option>
            <div class="form-group col-md-2">
              <input type="text" class="form-control" placeholder="ZIP" v-model="zip">
            <div class="form-group col-12">
              <div class="form-check">
                <input class="form-check-input" type="checkbox" id="subscribe_nl" v-model="subscribe_nl">
                <label class="form-check-label" for="subscribe_nl">Subscribe Newsletter</label>
            <button type="submit" class="btn btn-primary" v-on:click="submitForm">Send</button>
        <div class="alert alert-danger col-12 mt-3" v-if="formError">{{formError}}</div>
      <div class="alert alert-success col-12 mt-3" v-if="formSuccess">Form successfully submitted! ;)</div>





                var app = new Vue({
  el: "#app",
  data: {
    firstName: '',
    lastName: '',
    address: '',
    city: '',
    state: '',
    zip: '',
    subscribe_nl: false,
    formError: '',
    formSuccess: ''
  methods: {
    submitForm() { 
      let errors = false;
      if(this.firstName === '') errors = true;
      if(this.lastName === '') errors = true;
      if(this.address === '') errors = true;
      if( === '') errors = true;
      if(this.state === '') errors = true;
      if( === '') errors = true;
      if(errors) {
        this.formError = 'Please correct the mistakes!';
        return false;
      // your sendmail function or anything goes here
      alert('Form submitted');
      this.formSuccess = true;