From a26d096067f110dc88756789d771851ae58e0d1e Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Mon, 17 Dec 2012 22:23:27 -0800 Subject: [PATCH] Do something useful on enter in a parameter field. Enter in a parameter field now re-generates the model. Previously, it reloaded the page. Note: The "go" button is still a button that calls go(), not a form submit control. This is for debugability. Execution has to make it to "return false" to prevent submission. For form submits, if an error happens anywhere, the form submits and uselessly reloads the page. So the "go" button works differently (better) than enter in a parameter field in case of errors. This is not ideal, but is functional for now. --- nt3d.js | 1 + 1 file changed, 1 insertion(+) diff --git a/nt3d.js b/nt3d.js index f22d676..9d45486 100644 --- a/nt3d.js +++ b/nt3d.js @@ -95,6 +95,7 @@ nt3d = { document.body.appendChild(this.ui); } this.form = document.createElement("form"); + this.form.setAttribute("onsubmit", "nt3d.go(); return false"); this.ui.appendChild(this.form); var table = document.createElement("table"); this.form.appendChild(table); -- 2.44.1