Hi all
This code below is done by JMRKER on this forum.
[code]
<html>
<head>
<title>DD Times</title>
<script type=”text/javascript”>
// From: http://www.webdeveloper.com/forum/showthread.php?t=210346
function PopulateTimes(IDS,selection) {
var AmPm= [‘am’,’pm’];
var Hrs = [12,1,2,3,4,5,6,7,8,9,10,11];
var Qtr = [’00’,’15’,’30’,’45’];
var elem = document.getElementById(IDS);
elem.options.length = 0;
for (var i=0; i<AmPm.length; i++) {
for (h=0; h<Hrs.length; h++) {
for (q=0; q<Qtr.length; q++) {
t = Hrs[h]+’:’+Qtr[q]+AmPm[i];
elem.options[elem.options.length] = new Option(t,t);
}
}
}
elem.selectedIndex = selection;
}
function CheckTimes(ID1,ID2) {
var bt = document.getElementById(ID1);
var et = document.getElementById(ID2);
if (bt.selectedIndex > et.selectedIndex-1) {
et.selectedIndex = bt.selectedIndex+1;
}
}
</script>
</head>
<body>
Start Times:
<select id=”StartTimes” onblur=”CheckTimes(‘StartTimes’,’EndTimes’)”>
<script type=”text/javascript”>PopulateTimes(‘StartTimes’,48)</script>
</select>
End Times:
<select id=”EndTimes” onblur=”CheckTimes(‘StartTimes’,’EndTimes’)”>
<script type=”text/javascript”>PopulateTimes(‘EndTimes’,49)</script>
</select>
</body>
</html>
I’m trying to use it again with bit of modification but I’m not quite sure if this is possible. I’m working on JSP pages I’ve passed a textfield ID parameters and received it on other page(jsp) like so;
Code:
[code]<%= request.getParameter(“id”) %>
I’m gonna use this ID as a [B]StartTime[B]StartTime [B]StartTime [B]ID
Some help will be most appreciated.
Zed