/    Sign up×
Community /Pin to ProfileBookmark

Regarding Drop down box

Hi,
I need to create a drop down box in html for time table.In that i have to display every hour and every minute.So for diaplaying the minute value i have to use the [B]option tag for sixty times[/B] .How to put that in a loop to get sixty minute value in my drop down box.[B]I’m using php for server side scripting[/B]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@scragarMay 17.2005 — [code=php]<?
echo "<select name='min'>n";
for($i = 1; $i <= 60; $i++){
echo "<option value='$i'>$i</option>n";
};
echo "</select><select name='hour'>n";
for($i = 0; $i <= 23; $i++){
echo "<option value='$i'>".(($i >= 12)?($i-12)." pm":"$i am")."</option>n";
};
echo "</select>";
?>[/code]
×

Success!

Help @srikanth_s spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...