json={}; $('#test-form:input[type!=submit]') .map(function(){ if (this.type==="radio"){ json[this.name]=$(this).parent().text(); }else if(this.type==="select-one"){ json[this.name]=$(this).find("option:selected").text(); }else{ json[this.name]=this.value; } }); json = JSON.stringify(json);
Sign in to make a reply
WUDAJUN
json={}; $('#test-form:input[type!=submit]') .map(function(){ if (this.type==="radio"){ json[this.name]=$(this).parent().text(); }else if(this.type==="select-one"){ json[this.name]=$(this).find("option:selected").text(); }else{ json[this.name]=this.value; } }); json = JSON.stringify(json);