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>