473,387 Members | 1,549 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,387 software developers and data experts.

time picker in asp.net page

I have been programming in asp.net w/ vb for 3 years now and I feel a need
to include more client side script with javascript so here I am. Hopefully
in the right place. I have a timecard web app that I need to pick a starting
time in hour and minutes 3 times a day for 15 days. On the form I would like
to hit a button on Manday and popup an hour dropdown and minute dropdown and
submit them to the page without the page doing a postback. The minute
dropdown will only be every 15 minutes. Resulting in a textbox with
something like this > 14:30.
thanks in advance for any help offered
Dec 4 '05 #1
3 9121


Not sure if it may be just me, but I don't see the JS part of it yet,
though I can see it has one, but I don't follow what interactivity is
needed or processed.
Danny
Dec 4 '05 #2
Danny wrote on 04 dec 2005 in comp.lang.javascript:
Not sure if it may be just me, but I don't see the JS part of it yet,
though I can see it has one, but I don't follow what interactivity is
needed or processed.


No one of us sees anything
if you do not quote where you are talking about.

This is usenet.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 4 '05 #3
bg
Lee, this is perfect.
Note that I will have 14 days on thr form and a possible 3 in - outs for
each day.
Is there a way, or how can I make the picker float or move to the current
day button.
I am sure it it tied to " #timepicker {position:absolute;
top:50px;left:50px;".
thanks again,
dng

"Lee" <RE**************@cox.net> wrote in message
news:dm*********@drn.newsguy.com...
DotNetGuy said:

I have been programming in asp.net w/ vb for 3 years now and I feel a need
to include more client side script with javascript so here I am. Hopefully
in the right place. I have a timecard web app that I need to pick a
starting
time in hour and minutes 3 times a day for 15 days. On the form I would
like
to hit a button on Manday and popup an hour dropdown and minute dropdown
and
submit them to the page without the page doing a postback. The minute
dropdown will only be every 15 minutes. Resulting in a textbox with
something like this > 14:30.
thanks in advance for any help offered


Here's one way to do what I think you're asking for.
Note that it doesn't matter that this is an asp.net page.
The browser doesn't know or care how the page content was produced.
Note also that nothing is submitted and no new windows pop up.

<html>
<head>
<style type="text/css">
BUTTON {width:20em}
#timepicker {position:absolute;
top:50px;left:50px;
visibility:hidden;
border-style:solid;
border-width:1px;
background-color:wheat;
padding:2em;}
</style>
<script type="text/javascript">
function timepick(n) {
globalN=n;
document.getElementById("timepicker").style.visibi lity="visible";
}
function setTime(f) {
if(f) {
var HHMM=f.HH.options[f.HH.selectedIndex].text;
HHMM+=":"+f.MM.options[f.MM.selectedIndex].text;
document.getElementById("day"+globalN).innerHTML=H HMM;
}
document.getElementById("timepicker").style.visibi lity="hidden";
}
</script>
</head>
<body>
<button onclick="timepick(0)">Monday 2005-12-05</button>
<span id="day0" class="time">HH:MM</span><br>
<button onclick="timepick(1)">Tuesday 2005-12-06</button>
<span id="day1" class="time">HH:MM</span><br>
<button onclick="timepick(2)">Wednesday 2005-12-07</button>
<span id="day2" class="time">HH:MM</span><br>
</button>
<div id="timepicker">
<form>
<select name="HH">
<option>06</option>
<option>07</option>
<option selected>08</option>
</select>
<select name="MM">
<option selected>00</option>
<option>15</option>
<option>30</option>
<option>45</option>
</select>
<br><br>
<input type="button" value="OK" onclick="setTime(this.form)">
<input type="button" value="Cancel" onclick="setTime(false)">
</form>
</div>
</body>
</html>

Dec 5 '05 #4

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

Similar topics

2
by: john | last post by:
Can someone give me a url of a time picker? I found a lot of date/time picker but no timepicker alone. I just want a time picker. Thanks.
5
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an...
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 ...
3
by: TD | last post by:
This code doesn't work. Every posting I can find suggests that it should. If TypeOf controlname Is DTPicker then do something here End If I am using the Date Time Picker control and wish to...
7
by: XmlAdoNewbie | last post by:
Hi All, I am wondering if it is possible to allow nulls or empty strings when it comes to the datetimepicker control. I have an app with a few datetimepickers on it and there are some instances...
2
by: Need Helps | last post by:
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the graphical interface, and then used the...
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...
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.