//放在body里面 t:formvalid 外面
<div class="datagrid-toolbar" hidden="hidden" style="float:left; 100%;">
<a href="#" class="easyui-linkbutton l-btn l-btn-plain" plain="true" icon="icon-save" id="btn_sub" onclick="saveData1()">
</a>
</div>
<t:formvalid formid="formobj" dialog="true" usePlugin="password"
layout="table" beforeSubmit="fun_goods()" tiptype="1"
action="ldcGoodsController.do?doAdd_log">
//id 用t:formvalid 的id
//保存前校验
function saveData1(){
var type=$("#type" ).val()
var msg="";
var cusid=$("#cusid").val()
//if(cusid==''){
msg=msg+"委托客户不能为空;";
//}
if(msg==''){
$("#formobj").Validform({
callback:function(data){
if(data.success){
top.tip(data.msg);
}
}
}).ajaxPost(false,true);
window.location.reload();
}else{
$.dialog.setting.zIndex = getzIndex(true);
$.dialog.confirm(msg, function(r) {
if (r) {
$("#formobj").Validform({
callback:function(data){
if(data.success){
top.tip(data.msg);
}
}
}).ajaxPost(false,true);
window.location.reload();
}
})
}
}