Javascript: onChange / OnMouseOver events have all stopped firing

thank you for looking at my question,

I have a php page (attached) and the javascript functionality has stopped.

	echo '<td align="center" id="lblRTD">RTD<br/>';
		echo '<div class="tooltip"><input type="text" size="10" id="SpigotNoRTD" name="SpigotNoRTD" OnChange="jsHeatNoRTD()" OnMouseOver="jsMouseOverSpigotRTD()" tabindex="1"/>';
			echo '<span class="tipSpigotRTD" id="tipSpigotRTD"></span>';
		echo '</div>';
		
		echo '<input type="hidden" id="SpigotRTDPONo" name="SpigotRTDPONo"/>';
		echo '<input type="hidden" id="SpigotRTDDrgNo" name="SpigotRTDDrgNo"/>';
		echo '<input type="hidden" id="SpigotRTDRevNo" name="SpigotRTDRevNo"/>';
	echo '</td>';

Open in new window


the functionality is as follows
	function jsHeatNoRTD(){
		var HeatNoRTD = document.getElementById('SpigotNoRTD').value;

		var Pipe = HeatNoRTD.indexOf("|");
		var Tilda = HeatNoRTD.indexOf("~");
		var Aster = HeatNoRTD.indexOf("*");
		
		if(HeatNoRTD.length > 0){
			if (Pipe > 0)){
				var arrValues = HeatNoRTD.split("|");
			} else if (Tilda > 0){
				var arrValues = HeatNoRTD.split("~");
			} else if (Aster > 0){
				var arrValues = HeatNoRTD.split("*");
			}

			document.getElementById('SpigotNoRTD').value = arrValues[0];
			document.getElementById('SpigotRTDPONo').value = arrValues[1];
			document.getElementById('SpigotRTDDrgNo').value = arrValues[2];
			document.getElementById('SpigotRTDRevNo').value = arrValues[3];
		}
	}

	function jsMouseOverSpigotRTD(){
		if (document.getElementById('SpigotRTDPONo').value > 0){
			
			var SpigotRTDPONo = document.getElementById('SpigotRTDPONo').value;
			var SpigotRTDDrgNo = document.getElementById('SpigotRTDDrgNo').value;
			var SpigotRTDRevNo = document.getElementById('SpigotRTDRevNo').value;
			
			var TextString = "PO: " + SpigotRTDPONo + "\nDrg: " + SpigotRTDDrgNo + "\nRev: " + SpigotRTDRevNo;

			document.getElementsByClassName('tipSpigotRTD')[0].innerHTML = TextString;
		}
	}

Open in new window

the HeatNoRTD() function splits the input string around "|" or "*" or "~" character and the mouseover event displays the values in a tooltip but none of it works anymore.

as a diagnostic I changed the OnChange event to jsAlert()
	function jsAlert(){
		alert("Bingo!");
	}

Open in new window


but not even that is firing. Is this something to do with the way in which javascript is implemented. Other pages in the suite with similar constructs are working.

Please help.
KLTD1000_Step14.php
Section1.php
Gary CroxfordOperations Support AnalystAsked:
Who is Participating?
 
Julian HansenCommented:
I am guessing you have a javascript error on that page.

Open the console F12 (click console)
Load the page and look for errors.
0
 
Gary CroxfordOperations Support AnalystAuthor Commented:
Thank you - didn't know about the F12 thing, learnt something new
0
 
Julian HansenCommented:
You are welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.