Monday, 16 May 2016
Get Values by name attribute from serializeArray() using jquery and javascript
$('#form1').submit(function (e) {
e.preventDefault();
var values = {};
$.each($("#form1").serializeArray(), function (i, field) {
values[field.name] = field.value;
});
var getValue = function (valueName) {
return values[valueName];
};
var AnswerValue = getValue("radio_" + i);//Store values
}
e.preventDefault();
var values = {};
$.each($("#form1").serializeArray(), function (i, field) {
values[field.name] = field.value;
});
var getValue = function (valueName) {
return values[valueName];
};
var AnswerValue = getValue("radio_" + i);//Store values
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment