diff --git a/configs/c1p/serial/all.xml b/configs/c1p/serial/all.xml
index b4372ece7..7833c5e49 100644
--- a/configs/c1p/serial/all.xml
+++ b/configs/c1p/serial/all.xml
@@ -21,5 +21,5 @@
- SPACEWAR
Load File
-
+
diff --git a/configs/c1p/serial/samples.xml b/configs/c1p/serial/samples.xml
index 49900f086..bb0b268be 100644
--- a/configs/c1p/serial/samples.xml
+++ b/configs/c1p/serial/samples.xml
@@ -10,5 +10,5 @@
- PRESIDENTS
Load File
-
+
diff --git a/my_modules/c1pjs-client/lib/serial.js b/my_modules/c1pjs-client/lib/serial.js
index 71c2f9cdc..bf51851b5 100644
--- a/my_modules/c1pjs-client/lib/serial.js
+++ b/my_modules/c1pjs-client/lib/serial.js
@@ -127,15 +127,19 @@ C1PSerialPort.prototype.setBinding = function(c, t, s, e)
case "uploadSerial":
this.bindings[s] = e;
var serial = this;
- e.addEventListener('change', function () {
- var file = e.files[0];
+ e.onsubmit = function (event) {
+ var file = event.currentTarget[1].files[0];
+
var reader = new FileReader();
reader.onload = function () {
// serial.println("uploading " + file.name + "...");
serial.loadFile(file.name, reader.result, 0);
};
reader.readAsText(file);
- });
+
+ // Prevent reloading of web page after form submission
+ return false;
+ };
return true;
default:
break;
diff --git a/my_modules/c1pjs-client/templates/components.xsl b/my_modules/c1pjs-client/templates/components.xsl
index ec4a38463..b333923b3 100644
--- a/my_modules/c1pjs-client/templates/components.xsl
+++ b/my_modules/c1pjs-client/templates/components.xsl
@@ -286,7 +286,12 @@
-
+