Skip to content

Commit

Permalink
Fix FrontAccountingERP#14: Checkbox value now set in ajax calls
Browse files Browse the repository at this point in the history
- Changed utils.js in set the checkbox value = 0 for an unset checkbox
  rather than skipping the element.
  • Loading branch information
cambell-prince committed Aug 5, 2016
1 parent 4f8c525 commit f495647
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
}
if (el.type )
if(
((el.type == 'radio' || el.type == 'checkbox') && el.checked == false)
(el.type == 'radio' && el.checked == false)
|| (el.type == 'submit' && (!submitObj || el.name!=submitObj.name)))
continue;
if (el.disabled && el.disabled == true)
Expand All @@ -202,7 +202,11 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
q[name] = el;
else
{
q[name] = el.value;
if (el.type == 'checkbox') {
q[name] = (el.checked == true);
} else {
q[name] = el.value;
}
}
}
}
Expand Down

0 comments on commit f495647

Please sign in to comment.