Results 1 to 2 of 2

Thread: Issue in Displaying NaN values

  1. #1
    Join Date
    Sep 2010
    Posts
    188

    Issue in Displaying NaN values

    Hi..

    I created a function and I encountered problem because I got a NaN values. And I want to resolve it..I don't want to display NaN values. instead of NaN I just want it blank.

    here is my code:
    Code:
    function doz(oText){
        var P27_max = document.getElementById("P27_max").value;
        var P27_max_convert = parseFloat(P27_max) + parseFloat(1);   
        var P27_maxdoz = document.getElementById("P27_maxdoz").value = P27_max_convert;
        
        
        var P28_max = document.getElementById("P28_max").value;
        var P28_max_convert = parseFloat(P28_max) + parseFloat(2);
        var P28_maxdoz = document.getElementById("P28_maxdoz").value = P28_max_convert;
    }
    when I entered data in
    P27_max so the P27_maxdoz was computed but the problem is the P28_max has also value 'NaN'.

    How can I eliminate or did not display NaN

    Thank you

  2. #2
    Join Date
    Apr 2012
    Posts
    8
    You can check it with isNaN() function http://www.w3schools.com/jsref/jsref_isnan.asp

Similar Threads

  1. Background-color in IE6 Issue (not displaying)
    By Sol in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 04 Nov 2009, 06:21 AM
  2. Multiple Values + Mysql
    By Euphoria in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 13 Jun 2008, 01:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •