Javascript 使用div中的表验证文本<;部门>;或段落<;P>;

Javascript 使用div中的表验证文本<;部门>;或段落<;P>;,javascript,jquery,jeditable,Javascript,Jquery,Jeditable,我想在提交到服务器之前验证文本/数据。这是我的部门 <div class="edit" id="editme">edit me</div> 什么都没用。请帮帮我。如果有任何帮助,我将不胜感激,因为我的任务很艰巨。如果验证失败,只需返回false。您能否首先确保您的保存链接正常工作,并且为元素启用了表。顺便说一句,你有额外的“});”结尾是不需要的。 $('.edit').editable("${g.createLink(controller: 'comment'

我想在提交到服务器之前验证文本/数据。这是我的部门

<div class="edit" id="editme">edit me</div>

什么都没用。请帮帮我。

如果有任何帮助,我将不胜感激,因为我的任务很艰巨。如果验证失败,只需返回false。您能否首先确保您的保存链接正常工作,并且为元素启用了表。顺便说一句,你有额外的“});”结尾是不需要的。
    $('.edit').editable("${g.createLink(controller: 'comment', action:'editCommentForDocument')}",{
        event: 'dblclick',
        type      : 'autogrow',
        cancel    : 'Cancel',
        submit    : 'OK',
        indicator : '<img src="../images/spinner.gif">',
        tooltip   : 'Click to edit...',
        onblur    : ignore,
        submitdata : function(value, settings){
            if(value.trim() == ''){
                alert('empty');
            }

        },
        data : function(value, settings){
            if(value.trim() == ''){
                alert('empty');
            }
        },
        edit: {
            lineHeight : 12,
            minHeight  : 32
        }

    });


});
    onsubmit: function(settings, td) {
          var input = $(td).find('input');
          alert(input)   
     }