mirror of https://github.com/rancher/api-ui.git
NaN -> 0 for number fields
This commit is contained in:
parent
81d7e296ca
commit
df62d4315f
|
|
@ -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}}
|
||||
|
|
|
|||
|
|
@ -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' )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue