From 0f0e88d9fb45343eed91ca3626c2e9d41be9f414 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 11 Dec 2017 16:09:10 -0500 Subject: [PATCH] summary: Correct casting for scalars * src/current/scripts/entry-form.js: Ensure scalars are cast to numbers before outputting dfn. --- src/current/scripts/entry-form.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/current/scripts/entry-form.js b/src/current/scripts/entry-form.js index d633b05d..4a54312a 100644 --- a/src/current/scripts/entry-form.js +++ b/src/current/scripts/entry-form.js @@ -215,7 +215,7 @@ var client = ( function() var target = e.target, name = target.name.replace( /\[\]$/, '' ), - value = target.value.trim(); + value = +target.value.trim(); if ( !name ) { @@ -261,7 +261,7 @@ var client = ( function() bucket[ name ] = value; // update entry dfn - updateParamTestcaseDfn( target.name, value ); + updateParamTestcaseDfn( name, value ); } ); // update screen on submit @@ -318,9 +318,8 @@ var client = ( function() } ); - function updateParamTestcaseDfn( field_name, value ) + function updateParamTestcaseDfn( name, value ) { - const name = field_name.replace( /\[\]$/, '' ); const dfn_element = getParamTestcaseDfnElement( name ); value = value || bucket[ name ];