Link to home
Start Free TrialLog in
Avatar of Gary Croxford
Gary CroxfordFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary Croxford

ASKER

Thank you - didn't know about the F12 thing, learnt something new
You are welcome.