提交 c1b35f20 编写于 作者: D Devil

表单 select 获取数据优化

上级 2ec869df
......@@ -104,7 +104,7 @@ function GetFormVal(element, is_json)
var name = $(this).parents('select').attr('name');
if(name != undefined && name != '')
{
if($(this).is(':selected') && tmp.value != undefined && tmp.value != '')
if($(this).is(':selected'))
{
// 多选择
if($(this).parents('select').attr('multiple') != undefined)
......@@ -118,7 +118,10 @@ function GetFormVal(element, is_json)
i++;
} else {
// 单选择
object.append(name, tmp.value);
if(object[name] == undefined)
{
object.append(name, tmp.value);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册