#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Unable to get value of the property 'value': object is null or undefined


    I have this code:
    function ConvertWeight(form) {
    document.getElementById("WeightInLbs").value = document.getElementById("WeighInKg").value * 2.2;
    document.getElementById("WeightInKg").value = "";
    }

    And I get an error telling me that value is undefined but I can see it in the DOM tree.

    Why is this happenning?
  2. #2
  3. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    Welcome to DevShed, Nathe.

    Please post the entire document.
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0
    Originally Posted by Winters
    Welcome to DevShed, Nathe.

    Please post the entire document.
    It's a large document. The id's are valid text input tags.
  6. #4
  7. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    Well if the code and references are valid then I suppose I am superfluous. If you want further assistance you will need to post the rest of the document. There is nothing wrong with what you have posted, so the error lies elsewhere.
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0
    I found a way around it. The code is embedded in a CFM file and JQuery has the same problems. I think it is a ColdFusion problem.

IMN logo majestic logo threadwatch logo seochat tools logo