Fancy time picker javascript problem...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mkhines

    Fancy time picker javascript problem...

    Hello Javascript Experts (of which I am not ! ) --

    I'm trying to utilize a javascript I found on the web that allows a
    user to select a time of day from a simple control. The script works
    just fine in Internet Explorer (7) but doesn't work in Firefox when I
    use it in my form. Firefox gives me an error (using firebug) that
    says: "variablena me" is not defined) where variablename is the

    The odd thing about this is that the example that comes with the
    script I downloaded works fine, it's only when I put it into my form
    that it stops working. Even in Firefox...

    Here is the code download page: http://www.java2s.com/Code/JavaScrip...TimePicker.htm

    (there is a link to download a zip file of all the stuff with the
    example htm page included at the bottom of the screen)

    Any ideas?

    Thanks!!

    Megan
  • mkhines

    #2
    Re: Fancy time picker javascript problem...

    Oops I didn't finish this line

    where variablename is the name of the input text field where the
    script is supposed to be loaded onclick

    onclick="select Time(this,timep icker1)"

    the error firefox gives is 'timepicker1 is not defined'

    while IE loads the script without complaint

    On Aug 8, 10:56 am, mkhines <megan.hi...@gm ail.comwrote:
    Hello Javascript Experts (of which I am not ! ) --
    >
    I'm trying to utilize a javascript I found on the web that allows a
    user to select a time of day from a simple control.  The script works
    just fine in Internet Explorer (7) but doesn't work in Firefox when I
    use it in my form.  Firefox gives me an error (using firebug) that
    says: "variablena me" is not defined) where variablename is the
    >
    The odd thing about this is that the example that comes with the
    script I downloaded works fine, it's only when I put it into my form
    that it stops working.  Even in Firefox...
    >
    Here is the code download page:  http://www.java2s.com/Code/JavaScrip...TimePicker.htm
    >
    (there is a link to download a zip file of all the stuff with the
    example htm page included at the bottom of the screen)
    >
    Any ideas?
    >
    Thanks!!
    >
    Megan

    Comment

    • Tom Cole

      #3
      Re: Fancy time picker javascript problem...

      On Aug 8, 12:00 pm, mkhines <megan.hi...@gm ail.comwrote:
      Oops I didn't finish this line
      >
      where variablename is the name of the input text field where the
      script is supposed to be loaded onclick
      >
      onclick="select Time(this,timep icker1)"
      >
      the error firefox gives is 'timepicker1 is not defined'
      >
      while IE loads the script without complaint
      >
      On Aug 8, 10:56 am, mkhines <megan.hi...@gm ail.comwrote:
      >
      >
      >
      Hello Javascript Experts (of which I am not ! ) --
      >
      I'm trying to utilize a javascript I found on the web that allows a
      user to select a time of day from a simple control.  The script works
      just fine in Internet Explorer (7) but doesn't work in Firefox when I
      use it in my form.  Firefox gives me an error (using firebug) that
      says: "variablena me" is not defined) where variablename is the
      >
      The odd thing about this is that the example that comes with the
      script I downloaded works fine, it's only when I put it into my form
      that it stops working.  Even in Firefox...
      >
      Here is the code download page:  http://www.java2s.com/Code/JavaScrip...TimePicker.htm
      >
      (there is a link to download a zip file of all the stuff with the
      example htm page included at the bottom of the screen)
      >
      Any ideas?
      >
      Thanks!!
      >
      Megan- Hide quoted text -
      >
      - Show quoted text -
      Is timepicker1 the name or id of an element? if so you should be
      enclosing it in single quotes:

      onclick="select Time(this, 'timepicker1'); "

      If timepicker1 is an actual variable that has been assigned reference
      to an object, then I think you'll need to post more code so we can see
      this assignment plus the related HTML.

      Comment

      • David Mark

        #4
        Re: Fancy time picker javascript problem...

        On Aug 8, 11:56 am, mkhines <megan.hi...@gm ail.comwrote:
        Hello Javascript Experts (of which I am not ! ) --
        >
        I'm trying to utilize a javascript I found on the web that allows a
        user to select a time of day from a simple control.  The script works
        just fine in Internet Explorer (7) but doesn't work in Firefox when I
        use it in my form.  Firefox gives me an error (using firebug) that
        says: "variablena me" is not defined) where variablename is the
        >
        The odd thing about this is that the example that comes with the
        script I downloaded works fine, it's only when I put it into my form
        that it stops working.  Even in Firefox...
        >
        Here is the code download page:  http://www.java2s.com/Code/JavaScrip...TimePicker.htm
        >
        (there is a link to download a zip file of all the stuff with the
        example htm page included at the bottom of the screen)
        >
        Any ideas?
        Yes, don't use that script. The second line indicates it is from the
        JS dark ages:

        var ie=document.all ;

        It goes downhill after that:

        var dom=document.ge tElementById;
        var ns4=document.la yers;

        There's no need to read any further. This is clearly from the late
        90's and would have been considered incompetent then. Throw it away.
        The only reaaon the page exists today is to host advertising.

        Comment

        • mkhines

          #5
          Re: Fancy time picker javascript problem...

          On Aug 9, 8:53 am, David Mark <dmark.cins...@ gmail.comwrote:
          On Aug 8, 11:56 am, mkhines <megan.hi...@gm ail.comwrote:
          >
          >
          >
          Hello Javascript Experts (of which I am not ! ) --
          >
          I'm trying to utilize a javascript I found on the web that allows a
          user to select a time of day from a simple control.  The script works
          just fine in Internet Explorer (7) but doesn't work in Firefox when I
          use it in my form.  Firefox gives me an error (using firebug) that
          says: "variablena me" is not defined) where variablename is the
          >
          The odd thing about this is that the example that comes with the
          script I downloaded works fine, it's only when I put it into my form
          that it stops working.  Even in Firefox...
          >
          Here is the code download page:  http://www.java2s.com/Code/JavaScrip...TimePicker.htm
          >
          (there is a link to download a zip file of all the stuff with the
          example htm page included at the bottom of the screen)
          >
          Any ideas?
          OK. So I need some kind of similar form function that is a user-
          friendly way (and error preventing way) for users to pick a start and
          end time for a task. I haven't seen anything that is as intuitive
          that a bunch of volunteers would be able to grasp without too much
          training or fumbling.

          Any ideas?

          Is it too horrible to re-work?

          Thanks,
          Megan
          megan.hines@gma il.com
          >
          Yes, don't use that script.  The second line indicates it is from the
          JS dark ages:
          >
          var ie=document.all ;
          >
          It goes downhill after that:
          >
          var dom=document.ge tElementById;
          var ns4=document.la yers;
          >
          There's no need to read any further.  This is clearly from the late
          90's and would have been considered incompetent then.  Throw it away.
          The only reaaon the page exists today is to host advertising.

          Comment

          • Dr J R Stockton

            #6
            Re: Fancy time picker javascript problem...

            In comp.lang.javas cript message <35cf4d9b-7592-457c-9341-5fe1e29cb796@w7
            g2000hsa.google groups.com>, Mon, 11 Aug 2008 06:58:23, mkhines
            <megan.hines@gm ail.composted:
            >OK. So I need some kind of similar form function that is a user-
            >friendly way (and error preventing way) for users to pick a start and
            >end time for a task. I haven't seen anything that is as intuitive
            >that a bunch of volunteers would be able to grasp without too much
            >training or fumbling.
            For people of normal capability, and assuming that they should be
            allowed in the first instance to choose any time, the easiest and
            quickest way for all concerned is to get them to type it in numerically
            into an "input type-text", using the 24-hour clock. Allow arbitrary
            separators, so that the time will match /(\d+)\D+(\d+)/ and check the
            bracketed fields for value arithmetically.

            If serving chronologically-retarded locations, you might add a set of
            three radio buttons, 24-h clock / a.m. / p.m. or allow entry matching
            /(\d+)\D+(\d+).* (p)/i .

            --
            (c) John Stockton, nr London, UK. ?@merlyn.demon. co.uk Turnpike v6.05.
            Web <URL:http://www.merlyn.demo n.co.uk/- w. FAQish topics, links, acronyms
            PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/- see 00index.htm
            Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

            Comment

            Working...