VueJS Form Validation Example

VueJS Form Validation Example

In this Post We Will Explain About is VueJS Form Validation Example With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Form Validation with Vue JS Example

In this post we will show you Best way to implement Simple Vue Validator example, hear for Form Validation using Vue.js 2 with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Form Validation with Vue.js

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

Free Live Chat for Any Issue

Include External libs


<div id="liveApp">
    <li class="stud">
      <span>{{}} - {{}}</span>
  <form id="form">
  <ul class="errors">
    <li>Student Name cannot be empty.</li>
    <li>Please provide a valid Student email address.</li>


var baseURL = ''
var emailRE = /^(([^()[\]\\.,;:\[email protected]\"]+(\.[^()[\]\\.,;:\[email protected]\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

 * Setup firebase sync

var Students = new Firebase(baseURL + 'students')

Students.on('child_added', function (livedatasnap) {
  var stud_class = livedatasnap.val() = livedatasnap.key()

Students.on('child_removed', function (livedatasnap) {
  var id = livedatasnap.key()
  liveApp.students.some(function (stud) {
    if ( === id) {
      return true

 * Create Vue liveApp

var liveApp = new Vue({

  // element to mount to
  el: '#liveApp',

  // initial data
  data: {
    students: [],
    newstudent: {
      name: '',
      email: ''

  //addStudent computed property for form validation state
  computed: {
    validation: function () {
      return {
        name: !!,
        email: emailRE.test(
    isValid: function () {
      var validation = this.validation
      return Object.keys(validation).every(function (key) {
        return validation[key]

  //addStudent methods
  methods: {
    addStudent: function () {
      if (this.isValid) {
        Students.push(this.newstudent) = '' = ''
    removeStudent: function (stud) {
      new Firebase(baseURL + 'students/' +


body {
  font-family: Helvetica, Arial, sans-serif;

ul {
  padding: 0;

.stud {
  height: 30px;
  line-height: 30px;
  padding: 10px;
  border-top: 1px solid #eee;
  overflow: hidden;
  transition: all .25s ease;

.stud:last-child {
  border-bottom: 1px solid #eee;

.v-enter, .v-leave {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;

.errors {
  color: #f00;

Codepen Example

Read Also:  Responsive Dropdown Navigation Bar

You are Most welcome in my youtube Channel Please shubscibe my channel. and give me FeedBack.
More Details……
Angularjs Example



I hope you have Got What is Model-based Form Validation with Vue.js and Vuelidate And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.