function getFormValues(element,options) {
var data = {};
if(element == null || element == undefined) {
return data;
}
/** default options */
if (!options) { options = {checkBoxTrueValue:1,checkBoxFalseValue:0}; }
var trueValue = options['checkBoxTrueValue'];
var falseValue = options['checkBoxFalseValue'];
var elementsObj = element.get(0).elements;
var obj;
if (elementsObj) {
for ( var i = 0; i < elementsObj.length; i += 1) {
obj = elementsObj[i];
if (obj.tagName == "INPUT" || obj.tagName == "SELECT") {
if(obj.type == 'checkbox' || obj.type == 'radio'){
if($(obj).is(':checked')){
try{
if(options[obj.name+"_trueValue"] != undefined){
trueValue = options[obj.name+"_trueValue"];
}
}catch(e){
}
data[obj.name] = trueValue;
}else{
try{
if(options[obj.name+"_falseValue"] != undefined){
falseValue = options[obj.name+"_falseValue"];
}
}catch(e){
}
data[obj.name] = falseValue;
}
continue;
}
if(obj.name == "id" && obj.value == "") {
} else {
data[obj.name] = obj.value;
}
}
}
return data;
}
}