Skip to content

Commit

Permalink
NaN -> 0 for number fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent99 committed Feb 4, 2015
1 parent 81d7e29 commit df62d43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions partials/field.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<select name="{{formFieldName}}" class="form-control" onchange="htmlapi.createTypeChanged($(this).val());">
{{#each field.options}}
<option value="{{this}}" {{#ifEqual this ../value}} SELECTED{{/ifEqual}}>{{this}}</option>
<!-- {{this}} , {{../value}} -->
{{/each}}
</select>
{{/ifEqual}}
Expand Down
4 changes: 2 additions & 2 deletions src/HTMLApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1726,11 +1726,11 @@ HTMLApi.prototype.getFormValues = function(mode, method, schema)
}
else if ( field.type == 'int' && v !== null)
{
body[k] = parseInt(v,10);
body[k] = parseInt(v,10)||0;
}
else if ( field.type == 'float' && v !== null)
{
body[k] = parseFloat(v);
body[k] = parseFloat(v)||0;
}
else if ( typeof v != 'undefined' )
{
Expand Down

0 comments on commit df62d43

Please sign in to comment.