I trying to get the following code working... no success yet, so I suspect a formal error in the code somewhere.
<html>
<head>
<script>
var czUspresence as int
var czUscontrol as int
var czUssrpresence as int
var czUssrcontrol as int
function euGetstatus(){
var czUs = document.getElementById("cze_us").value;
var czUssr = document.getElementById("cze_ussr").value;
var sumCz = parseInt(czUs,10) - parseInt(czUssr,10)
if (sumCz < -2)
{czUssrcontrol = 1 ;
czUscontrol = 0;
czUssrpresence = 1;
if (czUs > 0)
{czUspresence = 1;
}
}
else if (sumCz > 2)
{czUscontrol = 1;
czUssrcontrol = 0;
czUspresence = 1;
if (czUssr > 0)
{czUssrpresence = 1;
}
}
else if (sumCz <> 0)
{if (czUs>czUssr)
{czUspresence = 1;
}
else
czUssrpresence = 1;
}
}
document.getElementById("euUsregular").value = sumUspresence;
document.getElementById("euUsbattleground").value = czUscontrol;
document.getElementById("euUssrregular").value = czUssrpresence;
document.getElementById("euUssrbattleground").value = czUssrcontrol;
}
</script>
</head>
<body>
<select style="position:absolute; left:919px; top:286px; background-color: blue; color: white;" id="cze_us" class="us" onchange="euGetstatus();">
<option selected>0 <option>1 <option>2 <option>3 <option>4 <option>5 <option>6 <option>7 <option>8 <option>9 <option>10 <option>11
</select>
<select style="position:absolute; left:956px; top:286px; background-color: red; color: white;" id="cze_ussr" class="ussr" onchange="euGetstatus();">
<option selected>0 <option>1 <option>2 <option>3 <option>4 <option>5 <option>6 <option>7 <option>8 <option>9 <option>10 <option>11
</select>
<input type="text" id="euUsregular" style="position:absolute; left:550px; top:150px; background-color: cyan; color: black" readonly=true size="2" value="" align="center"/>
<input type="text" id="euUsbattleground" style="position:absolute; left:550px; top:180px; background-color: cyan; color: black" readonly=true size="2" value="" align="center"/>
<input type="text" id="euUssrregular" style="position:absolute; left:600px; top:150px; background-color: pink; color: black" readonly=true size="2" value="" align="center"/>
<input type="text" id="euUssrbattleground" style="position:absolute; left:600px; top:180px; background-color: pink; color: black" readonly=true size="2" value="" align="center"/>
</body>
</html>
Can someone help with finding the error and/or correcting any mistake in there?
What I am trying to do is to check the two values (cze_us and cze_ussr) to see, which one is bigger and also their difference. One of the breaking points is (-)3, where the respective country would get cz****control and also cz****presence equal to 1.
When the difference is less then 3 and a country has more than 0 (cze_us or cze_ussr), that country gets only cz****presence equal to 1.
If a country has its cze_us(sr) value equal to 0, it does not get any cz****presence or control.
Hope I am clear ;)


Sign In
Create Account

Back to top









