?
Solved

12/24 hour clock: validation in a form field. ASP/Javascript

Posted on 2005-05-09
5
Medium Priority
?
290 Views
Last Modified: 2008-03-06
We would like for people to pick a time based on a drop down.

Here is an example

7:00am
7:30am
8:00am

and then when the form is submitted, keep it that way.  I need the code for this.

We are using ASP/Javascript
0
Comment
Question by:gizmoadria
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:archrajan
ID: 13962802
>>and then when the form is submitted, keep it that way.  I need the code for this.


do u mean when the form is submitted it shud be converted??
0
 

Author Comment

by:gizmoadria
ID: 13963406
When the form goes through, it should stay in that format of 00:00AM or 00:00PM.  I wanted to state that just in case!
0
 
LVL 25

Accepted Solution

by:
archrajan earned 500 total points
ID: 13963429
u need not do anything right to make it stay that way

for example

<select name = "time">
<option value = "7:00am">7:00am</option>
<option value = "7:30am">7:30am</option>
<option value = "8:30am">8:30am</option>
</select>

when the user submit  u can get the value of the selectbox which will not change!
0
 

Author Comment

by:gizmoadria
ID: 13970293
It's working great!

One last thing, how do I specify a default start time?   like 8:00am?
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13970403
<select name = "time">
<option value = "8:00am" selected>8:00am</option>
<option value = "7:00am">7:00am</option>
<option value = "7:30am">7:30am</option>
<option value = "8:30am">8:30am</option>
</select>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question