//获取单选和复选框的值
//parameters.type:"radio","checkbox"
//parameters.name:input-name
//parameters.flag:"0"-val,"1"-text
function getCheckedValue(parameters) {
var type = parameters.type;
var name = parameters.name;
var flag = parameters.flag;
var str = "";
var value = "";
$("input:"+type+"[name='"+name+"']:checked").each(function(i) {
if ("0" === flag) {
str = $(this).val();
} else {
str = $(this).parent().parent().text().trim();
}
if (0 === i) {
value = str;
} else {
value += "," + str;
}
});
return value;
}