Question john.smith4237 · Oct 25, 2024

if statement in JS not working!

Hi guys,

Strange that Horizontal in my below code is "Z" but the i(Horizontal=='Z') is actually not recognizing it and does execute the rest of the code !? 

(Horizontal,Vertical)=""
Set Horizontal= ..GetSensorInfo($P(Temp))
&js<var Horizontal='#(Horizontal)#';
   alert(Sensor+"="+Horizontal)
  if (Horizontal=='Z')
  {
    alert(Sensor+"=2"+Horizontal)          

 document.getElementById('Z'+i).value='H'
  }

Thanks

Product version: Ensemble 2018.1

Comments

john.smith4237 · Oct 25, 2024

Never mind guys there  was an extra spaces causing the problem  

0