Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi am getting this javascript runtime error "Unable to get property 'select' of undefined or null reference"
JavaScript
}
   function EnsureCompletionDateNULL() {
     var retval = true;
     var txtbx = document.getElementById('xbIACA__IACA_Completion_Date');
     if (txtbx.value != "") {
       alert("The Completion Date must be removed to continue with the requested action.");
       setTimeout(function(){txtbx.focus().select();},1);
       retval = false;
     }
     return retval;
   }
Posted
Updated 30-Jun-15 5:36am
v2

1 solution

The focus[^] method does not return a value. You cannot call a method on the returned value, because there is no value returned.

JavaScript
setTimeout(function(){ txtbx.focus(); txtbx.select(); },1);
 
Share this answer
 

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