Questa è la pagina. Ti ho scritto dove funziona e dove no. Puoi notare che se apri la pagina negli input compare la stessa stringa ma quando la carico nel web server del PLC funziona solo uno
codice:
<!DOCTYPE html >
<!-- AWP_In_Variable Name='"variabili_DB".N DI STEP' -->
<html lang="it" id="dd" >
<head >
<meta charset="utf-8" />
<meta http-equiv="refresh" content="25">
<title>
PAGINA 2
</title>
<link href="CSS.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="file.js"></script>
</head>
<body >
<header id="vv">
<div style="border:double">
<!--<a href="INDEX.html">HOME</a>-->
<a href="CLIMA.html">CLIMA</a>
</div>
</header><br /><br />
<!--<div style="border:double;height:auto;width:300px" id="div">
</div><br />-->
<form>
<input id="Submit1" type="submit" value="submit" hidden/>
SET STEP 0:<input type="text" id="SET STEP 0" value=':="SET STEP 0"::="variabili".SET STEP 0:' name='"variabili".SET STEP 0'/>questo funziona
</form>
<input id="Text1" type="text" hidden/>
<script type="text/javascript">
// var n_di_step = document.getElementById("N DI STEP").value;
commenti();
function commenti() {
var prima = document.getElementById("dd");
for (a = 0; a < 5; a++) {
var comme = document.createComment(" AWP_In_Variable Name=" + "\'\"variabili\"." + "SET STEP " + a + "\'");
//document.body.appendChild(comme);
document.insertBefore(comme, prima);
}
}
var pp = document.getElementById("SET STEP 0").value;
var dd = ':="SET STEP 0"::="variabili".SET STEP 0:';
var div = document.createElement("div");
div.setAttribute("style", "border:double;height:auto;width:900px;float:left");
div.setAttribute("id","div");
var titolo = document.createElement("h4")
var testo = document.createTextNode("VENTILAZIONE");
titolo.setAttribute("style", "text-aling:center");
titolo.appendChild(testo);
div.appendChild(titolo);
var gg = document.getElementById("vv");
for (q = 0; q < 5; q++) {
var form = document.createElement("form");
var h4 = document.createElement("h4");
var h4_nome = document.createTextNode("SET STEP " + q + ":"+"(questo non funziona)")
var a_capo = document.createElement("br");
var submit = document.createElement("input");
submit.setAttribute("type", "submit");
submit.setAttribute("class", "bottone");
var submi_nome = document.createTextNode("SALVA");
submit.appendChild(submi_nome);
var input = document.createElement("input");
var qq = new String(q);
var input_nome = "\"variabili\".SET STEP " + q;
var input_value = ':="SET STEP ' +qq + '"::="variabili".SET STEP ' + qq + ':';
input.setAttribute("type", "text");
input.setAttribute("id", "SET STEP " + q);
input.setAttribute("style", "float:right");
input.setAttribute('name', input_nome);
input.setAttribute("value", input_value);
h4.appendChild(h4_nome);
h4.appendChild(submit);
h4.appendChild(input);
h4.appendChild(a_capo);
form.appendChild(h4);
div.appendChild(form);
};
//document.getElementById("Text1").value = input_value;
//document.body.appendChild(div);
gg.appendChild(div);
crea();
function crea(){
var val=':="SET STEP ' + "0" + '"::="variabili".SET STEP ' + "0" + ':'
var pos=document.getElementById("Button1");
var inputt=document.createElement("input");
var testo = document.createTextNode("questo non funziona");
//inputt.appendChild(testo);
inputt.setAttribute("type","text");
inputt.setAttribute("value",val);
document.body.appendChild(inputt);
document.body.appendChild(testo);
};
</script>
</body>
</html>