my plugin help

my plugin help

hey guys i've made a plugin for my site which allows the user to edit thier data ie. editable table

as seen here: https://jsfiddle.net/dom484wo/

i have 2 problems

problem 1. validation

in line 251 i'm trying to apply validation to all input containing 'name', which is referring to the inputs that show in 1st column (name1, name2)

  1.     $("input[name*='name']").rules("add", {
             required: true,
            messages: {
                required: "Name: Name is required."
            }
        });
       
        $("#test-form").validate({
            errorPlacement: function(error, element){
                error.insertAfter(element);
                }
        });

but i'm really strugging to get it to work...also i get an error:

  1. jQuery.Deferred exception: d is undefined .rules@https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js:15:261
    window.onload/<@https://fiddle.jshell.net/_display/:375:2
    g/</j@https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:2:29946
    g/</k<@https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:2:30262
     undefined  jquery.min.js:2:31515
    TypeError: d is undefined[Learn More]  jquery.validate.min.js:15:261


problem 2:

on line 264 im trying to determine if the table is empy ie. all rows deleted....which also doesnt work.


  1.     $("#editable-table-row-options-menu .editable-table-row-delete").click(function() {
            if(test_table.is_empty()){
                console.log('table is empty');
            }
        })


i hope i can get a repsone to how i can get these problems fixed....thank you