Files
AI-on-the-edge-device/sd-card/html/prevalue_set.html
jomjol 40953091d7 Update html-style
Update of HTML
2020-09-09 21:34:51 +02:00

84 lines
2.1 KiB
HTML

<html><head>
<title>jomjol - AI on the edge</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
//<![CDATA[
//]]>
</script>
</head>
<style>
h1 {font-size: 2em;}
h2 {font-size: 1.5em;}
p {font-size: 1em;}
</style>
<script>
function includeHTML() {
var z, i, elmnt, file, xhttp;
/* Loop through a collection of all HTML elements: */
z = document.getElementsByTagName("*");
for (i = 0; i < z.length; i++) {
elmnt = z[i];
/*search for elements with a certain atrribute:*/
file = elmnt.getAttribute("w3-include-html");
if (file) {
/* Make an HTTP request using the attribute value as the file name: */
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
/* Remove the attribute, and call this function once more: */
elmnt.removeAttribute("w3-include-html");
includeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
/* Exit the function: */
return;
}
}
}
</script>
<body style="font-family: arial">
<table style="width:100%">
<tr>
<h2>Current Value:</h2><p>
<div w3-include-html="/setPreValue.html"></div>
</tr>
<tr>
<h2>Set Value:</h2><p>
Input (Format = 123.456):<p>
PreValue:
<input type="number" id="myInput" name="myInput"
pattern="[0-9]+([\.,][0-9]+)?" step="0.001"
title="This should be a number with up to 4 decimal places.">
<button type="button" onclick="setprevalue()">Set PreValue</button>
</tr>
<tr>
<h2>Result:</h2><p>
<div id="result"> </div>
</tr>
</table>
<script>
function setprevalue() {
var inputVal = document.getElementById("myInput").value;
inputVal = inputVal.replace(",", ".");
_value = "<object data=" + "/setPreValue.html?value=" + inputVal + " ></object>";
document.getElementById("result").innerHTML=_value;
// location.reload();
}
</script>
<script>
includeHTML();
</script>
</body></html>