ainoy31 Posted December 7, 2007 Share Posted December 7, 2007 Hello- I have a form the calculates the total dimension weight and chargeable weight. However, these two fields are calculated base on what is entered prior. So, as I enter my measurements, in the total dimension and chargeable fields I see NaN and undefined pop up. However, once I finish entering all my measurements, NaN and undefined goes away and displays the correct results. Does anyone know a fix for this? Much appreciation. AM Link to comment https://forums.phpfreaks.com/topic/80677-solved-nan-and-undefined-in-javascript/ Share on other sites More sharing options...
ainoy31 Posted December 7, 2007 Author Share Posted December 7, 2007 Nevermind. I fixed my issue. The problem was that I was passing in the var result where I am calculating the total. First, I needed to check to see is the var result was null or not. If is was, I need to set my total dimension value to 0. if(result == null) { document.getElementById('tot_dim').value = ''; ....and so on. } Link to comment https://forums.phpfreaks.com/topic/80677-solved-nan-and-undefined-in-javascript/#findComment-409177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.