• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

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

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
gizmoadria
Asked:
gizmoadria
  • 3
  • 2
1 Solution
 
archrajanCommented:
>>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
 
gizmoadriaAuthor Commented:
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
 
archrajanCommented:
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
 
gizmoadriaAuthor Commented:
It's working great!

One last thing, how do I specify a default start time?   like 8:00am?
0
 
archrajanCommented:
<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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now