Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > event question for a time input field

Reply
Thread Tools

event question for a time input field

 
 
JRough
Guest
Posts: n/a
 
      02-02-2012

I have a datefield with a YUI calendar object drop down with a
customized time field that is displayed at the bottom of the
calendar. The time field is just an input field that allows the user
to change the time and then a submit button with code that filters the
data based on the date and time of day.


S M T W TH F S
1 2 3 4
5 6 7 8 9 10 11 .................

Time: [ 12:01:60]

What I need to do is attach select drop downs on the time field
object for the hours, minutes, and seconds.
It is heavily customized and fragile code . Is there an event that
would tell me whether
the user clicks on the hours, or minutes or seconds? My idea is just
to take the hours or minutes or seconds that the user
clicks and create a drop down select option list starting with for
example 12:00, 13:00, 14:00, etc. I just want to know how to do
it.
The best would be the YUI 3 timepicker but this is YUI 2 and I just
want to see if this works first.
Thanks,
J R
 
Reply With Quote
 
 
 
 
Erwin Moller
Guest
Posts: n/a
 
      02-02-2012
On 2/2/2012 7:46 PM, JRough wrote:
>
> I have a datefield with a YUI calendar object drop down with a
> customized time field that is displayed at the bottom of the
> calendar. The time field is just an input field that allows the user
> to change the time and then a submit button with code that filters the
> data based on the date and time of day.
>
>
> S M T W TH F S
> 1 2 3 4
> 5 6 7 8 9 10 11 .................
>
> Time: [ 12:01:60]
>
> What I need to do is attach select drop downs on the time field
> object for the hours, minutes, and seconds.
> It is heavily customized and fragile code . Is there an event that
> would tell me whether
> the user clicks on the hours, or minutes or seconds? My idea is just
> to take the hours or minutes or seconds that the user
> clicks and create a drop down select option list starting with for
> example 12:00, 13:00, 14:00, etc. I just want to know how to do
> it.
> The best would be the YUI 3 timepicker but this is YUI 2 and I just
> want to see if this works first.
> Thanks,
> J R


JR,

If the code is "heavily customized and fragile" as you claimed, and if
the code is unknown to us, what kind of help do you expect to receive
from this community?

My advice: Study the code yourself, learn Javascript, and fix/modify it
to suit your needs.
If that doesn't work for you, hire a competent coder.

Regards,
Erwin Moller


--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
 
Reply With Quote
 
 
 
 
Dr J R Stockton
Guest
Posts: n/a
 
      02-03-2012
In comp.lang.javascript message <085b2fe7-5c2f-467c-86cc-ffa45eaf2355@og
8g2000pbb.googlegroups.com>, Thu, 2 Feb 2012 10:46:17, JRough
<(E-Mail Removed)> posted:

>I have a datefield with a YUI calendar object drop down with a
>customized time field that is displayed at the bottom of the
>calendar. The time field is just an input field that allows the user
>to change the time and then a submit button with code that filters the
>data based on the date and time of day.


This is a waste of time, because it will be quicker and easier to insert
the numeric date and time from a standard keyboard into a single text
field. If you are explicitly rigorous about the field order, you can be
liberal about the separators, allowing spaces to separate fields. If
your users may not have keyboards, code one with a dozen or so buttons.

Validate the pattern with a RegExp match, and validate the values by
read-back from a Date Object.

If validation fails, allow the input line to be edited; do not force
full re-entry.

--
(c) John Stockton, nr London UK ?@merlyn.demon.co.uk IE8 FF8 Op11 Sf5 Cr15
news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
<http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
how can i catch a lost focus event from an input field inside a form =?ISO-8859-15?Q?Josef_Bl=F6sl?= HTML 1 07-20-2005 10:54 AM
Formatting a time field to 24 hour time (Military time) in the Datagrid David Hearn ASP .Net Datagrid Control 1 09-10-2003 02:50 PM



Advertisments