日期:2014-05-16  浏览次数:20555 次

easyui
本帖最后由 showbo 于 2012-09-29 16:20:17 编辑
我想用easyui的日期,但是传不到ajax,

/*----------执行员工添加操作-------*/
function employeeAdd(){
var validateResult = true;
//easyui 表单验证
$('#table_employeeAdd input').each(function () {
if ($(this).attr('required') || $(this).attr('validType')) {
if (!$(this).validatebox('isValid')) {
//如果验证不通过,则返回false
validateResult = false;
return;
    }
}
    });
if(validateResult==false){
return;
}

$.ajax({
async : false,
cache:false,       
type: 'POST',
dataType : "json",
data : {
"employee.fchrEmployeeCode" : $("#employeeAdd_fchrEmployeeCode").val(),
"employee.fchrEmployeeName" : $("#employeeAdd_fchrEmployeeName").val(),
"employee.fchrParentDepartment" : $("#employeeAdd_fchrParentDepartment").val(),
"employee.fchrParentName" : $("#employeeAdd_fchrParentName").val(),
"employee.fdtCreateTime" : $("#employeeAdd_fdtCreateTime").val(),
"employee.fchrEmployeePhone" : $("#employeeAdd_fchrEmployeePhone").val(),
"employee.fchrEmployeeEmail" : $("#employeeAdd_fchrEmployeeEmail").val(),
"employee.fchrEmployeeAddr" : $("#employeeAdd_fchrEmployeeAddr").val()
 

},
url: root+'/ospm/employee/doEmployeeAdd.jhtml',//请求的action路径 
error: function () {//请求失败处理函数
alert('请求失败');
},success:function(data){
var messgage = "添加成功!";
 
if(data==null){//未返回任何消息表示添加成功
employeeAddReset();
//刷新列表
reloadTable();
}else if(data.errorMsg!=null){//返回异常信息
messgage = data.errorMsg;
}
$("#employeeAdd_message").html(messgage);
}
});
}




<label>入职时间:</label>
<input type="text" class="easyui-datebox" id="employeeAdd_fdtCreateTime"  ></input>

------解决方案--------------------
就你那个代码没什么问题,可以那样获取的,你的获取不到是什么意思?