SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: TypeError

  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unhappy TypeError

    Hello,
    I m new to Js and i am getting this error. i dont understand why because the id is there
    All those who wander aren't lost.

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Where are you seeing the error.
    The Fiddle works as it should for me.

  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Hi,

    Where are you seeing the error.
    The Fiddle works as it should for me.
    I am using firefox and firebug shows that error also nothing happens when i do the required action
    All those who wander aren't lost.

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Sorry, it works as expected for me in the latest FF (20.0.1).

    The only thing I noticed was that:

    HTML Code:
    <label for="storename">Store Name</label>
    should be:

    HTML Code:
    <label for="storeName">Store Name</label>

  5. #5
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I have updated the fiddle to my complete one. Pls have a look now
    All those who wander aren't lost.

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Do you have a new link?
    I'm still seeing the old fiddle.

  7. #7
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Do you have a new link?
    I'm still seeing the old fiddle.
    here
    All those who wander aren't lost.

  8. #8
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    That works exactly as expected for me in the latest FF and Chrome, too.
    I don't know if that is a good thing or a bad thing

    What is it exactly that you are trying to do?
    How can I reproduce your error?

  9. #9
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is my head section
    Code HTML4Strict:
     <!DOCTYPE html>
         <title>Form</title>
        <head>
        <link rel="stylesheet" href="style.css">    
        <script type="text/javascript" src="script.js"></script>
        </head>
    i am trying to make a form on which some fields are mandatory without it the form won't submit and on submit i will send a email most probably via php function
    even if chorme i am getting
    Uncaught TypeError: Cannot set property 'onblur' of null
    All those who wander aren't lost.

  10. #10
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Ah, ok. What is (very probably) happening that is you are including your JS file at the top of your document and it is trying to reference elements on the page before they exist.

    Try moving it to the bottom of your page, like this:

    HTML Code:
    <!DOCTYPE HTML>
      <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Fom</title>
      </head>
    
      <body>
        ... Your Content ...
        <script type="text/javascript" src="script.js"></script>
      </body>
    </html>
    Also, in the code you posted, the <title> element should come within the <head> element.

    HTH

  11. #11
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks! that worked!.
    All those who wander aren't lost.

  12. #12
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Glad to hear it!
    That can be a bit of a gotcha moment when you first encounter it


Bookmarks

Posting Permissions

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