Click here to Skip to main content
15,037,009 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
We are getting the following error on line 5 of the following script;

Uanble to get property 'value' of undefined or null reference
C#
function initPart() {
	if (!(prepop)) {
		//loadActivities();
		//loadSecLevels();
		loadValues("seclevel", "getseclevels.asp?sl=" + document.getElementById("selSecLevel").value);
		loadCaveats();
		loadLookup("Priority", "ROUTINE");
		loadLookup("Releasability", "");
		}
}

function validateCreate() {
  var classuri = document.getElementById("classuri");
  if (classuri.value == 0) {
    showError("Error - This field is mandatory and must be completed - Activity");
    return false;
  }
}

My knowledge of Javascript is minimal so any help would be great.

Thanks

Matt Hunter
Posted
Updated 1-Oct-17 20:46pm
v2

1 solution

Assuming that line 5 is:
JavaScript
loadValues("seclevel", "getseclevels.asp?sl=" + document.getElementById("selSecLevel").value);

one can only suspect that document.getElementById("selSecLevel") is returning a null reference, i.e. it cannot find an element with that id.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900