Skip to content

Instantly share code, notes, and snippets.

@genescheck
Forked from matt-diehl/contact_form.js
Last active August 29, 2015 14:15
Show Gist options
  • Save genescheck/1aabf4601d3545e66ae3 to your computer and use it in GitHub Desktop.
Save genescheck/1aabf4601d3545e66ae3 to your computer and use it in GitHub Desktop.

Revisions

  1. Matt revised this gist Apr 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion contact_form.js
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ var ContactForm = (function () {

    bindUIActions: function () {
    s.submitBtn.on("click", function() {
    if !(ContactForm.validate()) {
    if (!ContactForm.validate()) {
    // If it doesn't validate, show some errors
    }
    });
  2. Matt revised this gist Mar 18, 2013. 1 changed file with 24 additions and 24 deletions.
    48 changes: 24 additions & 24 deletions contact_form.js
    Original file line number Diff line number Diff line change
    @@ -1,33 +1,33 @@
    var ContactForm = (function () {
    var s;

    return {
    settings: {
    return {
    settings: {
    inputs: $("#contact_form input"),
    submitBtn: $(".js-contact_form-submit")
    },

    init: function() {
    s = this.settings;
    this.bindUIActions();
    },

    bindUIActions: function () {
    s.submitBtn.on("click", function() {
    submitBtn: $(".js-contact_form-submit")
    },
    init: function() {
    s = this.settings;
    this.bindUIActions();
    },
    bindUIActions: function () {
    s.submitBtn.on("click", function() {
    if !(ContactForm.validate()) {
    // If it doesn't validate, show some errors
    }
    });

    },

    validate: function (s.inputs) {
    inputs.each(function() {
    // Do some validation here.
    }
    }
    });


    };
    },

    validate: function (s.inputs) {
    inputs.each(function() {
    // Do some validation here.
    }
    }


    };
    })();
    ContactForm.init();
  3. Matt created this gist Mar 18, 2013.
    33 changes: 33 additions & 0 deletions contact_form.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    var ContactForm = (function () {
    var s;

    return {
    settings: {
    inputs: $("#contact_form input"),
    submitBtn: $(".js-contact_form-submit")
    },

    init: function() {
    s = this.settings;
    this.bindUIActions();
    },

    bindUIActions: function () {
    s.submitBtn.on("click", function() {
    if !(ContactForm.validate()) {
    // If it doesn't validate, show some errors
    }
    });

    },

    validate: function (s.inputs) {
    inputs.each(function() {
    // Do some validation here.
    }
    }


    };
    })();
    ContactForm.init();