You might like to try using the following
if statement:
Code:
if(document.RealEstate["INSPECTION_TIME_D"+x] && (document.RealEstate["INSPECTION_TIME_D"+x].value != "----")) {
That checks if
document.RealEstate.INSPECTION_TIME_Dx exists and if its
value property doesn't equal "
----". The first check isn't 100% necessary but trying to get the
value will throw up JS errors if the item doesn't exist.