473,390 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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: "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/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
Aug 8 '08 #1
5 2721
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 <megan.hi...@gmail.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: "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/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
Aug 8 '08 #2
On Aug 8, 12:00*pm, mkhines <megan.hi...@gmail.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="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 <megan.hi...@gmail.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: "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/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="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.
Aug 8 '08 #3
On Aug 8, 11:56*am, mkhines <megan.hi...@gmail.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: "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/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.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.
Aug 9 '08 #4
On Aug 9, 8:53*am, David Mark <dmark.cins...@gmail.comwrote:
On Aug 8, 11:56*am, mkhines <megan.hi...@gmail.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: "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/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
me*********@gmail.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.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.
Aug 11 '08 #5
In comp.lang.javascript message <35cf4d9b-7592-457c-9341-5fe1e29cb796@w7
g2000hsa.googlegroups.com>, Mon, 11 Aug 2008 06:58:23, mkhines
<me*********@gmail.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.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.
Aug 11 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: timmy_dale12 | last post by:
I have a time field in an application. I am looking for some kind of pop up function that lets me insert a time. So its like a calendar pop up but you can choose a valid time instead of a date ...
13
by: Hussein Patwa | last post by:
Hi there. I'm new to this group. I'm also partially sighted so navigating the web is sometimes quite difficult. I'm looking for a javascript date picker, you know the ones that travel sites...
1
by: zeeshan359 | last post by:
Hi, I need free script that is "date and time" picker in javascript without popup, It should be in iframe or div or layers. I shall be thankful to you, if you provide me some details of it....
4
by: Michael Turner | last post by:
Hi Guys I have two DateTime pickers one shows the Date and the other the time, this is a requirement of the solution. The problem I have is that when the time is saved to the sql database into a...
4
by: Michel Posseth [MCP] | last post by:
I have a problem with the date time picker validate event wich i believe is a bug How to reproduce : throw on a form a date time picker control and a textbox control select the validating...
2
by: Alfred | last post by:
I need a calendar + time picker tool that is: * public domain * non-AJAX (at this time) * javascript * works in IE 6 and Firefox 1.5 and up * div-based * uses CSS too * permits not just...
0
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the...
2
by: pradeeplnarayan | last post by:
Hi Peers, I like to have a simple time picker in javascript, similar to the one that is in our windows OS (Double click the time in your windows sytem tray). It should allow users to set only...
4
by: Arun | last post by:
I came across a message sometime back in 2002. Here's a link:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.