Fancy time picker javascript problem...

Discussion in 'Javascript' started by mkhines, Aug 8, 2008.

  1. mkhines

    mkhines Guest

    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: "variablename" 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/JavaScript/GUI-Components/FancyTimePicker.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, Aug 8, 2008
    #1
    1. Advertising

  2. mkhines

    mkhines Guest

    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="selectTime(this,timepicker1)"

    the error firefox gives is 'timepicker1 is not defined'

    while IE loads the script without complaint

    On Aug 8, 10:56 am, mkhines <> wrote:
    > 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: "variablename" 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/JavaScript/GUI-Components/FancyTimePicker.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, Aug 8, 2008
    #2
    1. Advertising

  3. mkhines

    Tom Cole Guest

    On Aug 8, 12:00 pm, mkhines <> wrote:
    > 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="selectTime(this,timepicker1)"
    >
    > the error firefox gives is 'timepicker1 is not defined'
    >
    > while IE loads the script without complaint
    >
    > On Aug 8, 10:56 am, mkhines <> wrote:
    >
    >
    >
    > > 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: "variablename" 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/JavaScript/GUI-Components/FancyTimePicker.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="selectTime(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.
     
    Tom Cole, Aug 8, 2008
    #3
  4. mkhines

    David Mark Guest

    On Aug 8, 11:56 am, mkhines <> wrote:
    > 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: "variablename" 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/JavaScript/GUI-Components/FancyTimePicker.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.getElementById;
    var ns4=document.layers;

    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.
     
    David Mark, Aug 9, 2008
    #4
  5. mkhines

    mkhines Guest

    On Aug 9, 8:53 am, David Mark <> wrote:
    > On Aug 8, 11:56 am, mkhines <> wrote:
    >
    >
    >
    > > 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: "variablename" 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/JavaScript/GUI-Components/FancyTimePicker.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


    >
    > 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.getElementById;
    > var ns4=document.layers;
    >
    > 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.
     
    mkhines, Aug 11, 2008
    #5
  6. In comp.lang.javascript message <35cf4d9b-7592-457c-9341-5fe1e29cb796@w7
    g2000hsa.googlegroups.com>, Mon, 11 Aug 2008 06:58:23, mkhines
    <> posted:

    >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.demon.co.uk/> - w. FAQish topics, links, acronyms
    PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
    Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
     
    Dr J R Stockton, Aug 11, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman

    Date Time Picker

    Charles A. Lackman, Nov 24, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    1,069
  2. Robert

    JScript time picker

    Robert, Jul 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    951
    Eliyahu Goldin
    Jul 7, 2003
  3. Blue Streak
    Replies:
    1
    Views:
    514
    aa7im
    Mar 21, 2005
  4. Ramon F Herrera
    Replies:
    4
    Views:
    361
    Ian Collins
    Sep 28, 2009
  5. Replies:
    1
    Views:
    149
Loading...

Share This Page