Needs help about date pick from drop down boxes

Asked By 10 points N/A Posted on -
qa-featured

Good day, I am trying to create a date picker where all fields (Y M D) are all drop down Menus and automatically the month selected affects how many days are available to select in the day field. I want to use one form and inside that I will add all three form components to accept month date and year from the visitors that way I can create a date format which we can use in and SQL query to insert to any database or store. The format yyyy-mm-dd is used to store in a date field of mysql table. I don't want calendar displayed in any way.

SHARE
Answered By 0 points N/A #130343

Needs help about date pick from drop down boxes

qa-featured

Hi Madmoore,

Try this code:
DECLARE @today varchar(10)
SET @today = CONVERT(VARCHAR(10), GETDATE(), 105)
Print @today
You can change the variables depending on your preference. The variable at top of the code indicates the length of the character that will be shown.

OR

You can also try this using a JQuery UI Framework :

<input type="text" name="datepicker" id="datepicker">

<script>
$(function() {
  $( "#datepicker" ).datepicker({dateFormat : 'yyyy-mm-dd'});
});
</script>

Login/Register to Answer

Related Questions