Answered by:
About Calendar

Question
-
User544906106 posted
Dear all,
I have two small question,
1))
I set my database like below ::
ConsractStartDate ; date ; can null // ConsractEndDate ; date ; can null
I want to save the available date of all contracts, some contract have no limits ,it's forever, like this i don't have to record the date ,
but no matter how i tried, it will save data like this "1900/1/1 AM 12:00:00" ---> This is not what i want.
If i don't enter any date in my text box , Can it be Null? not save the default date .
2))
I am doing the
I have two Textbox for users to enter the Contract Start date and End date,
I design a img-btn , when i click , Calandar will appear and can choose a date,
How can i use one calandar and put the date in the Textbox?
Thanks
Regards
Tuesday, December 5, 2017 8:17 AM
Answers
-
User2103319870 posted
I have two Textbox for users to enter the Contract Start date and End date, I design a img-btn , when i click , Calandar will appear and can choose a date,How can i use one calandar and put the date in the Textbox?
You could take a look at Jquery DatePicker for calendar control in textbox
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Icon trigger</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker({ showOn: "button", <!-- Change the image path as per your soluiton here --> buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif", buttonImageOnly: true, buttonText: "Select date" }); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 6, 2017 3:15 AM -
User-335504541 posted
Hi <g class="gr_ gr_19 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="19" data-gr-id="19">PPetee</g>,
but no matter how <g class="gr_ gr_25 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="25" data-gr-id="25">i</g> tried, it will save data like this "1900/1/1 AM 12:00:00" ---> This is not what <g class="gr_ gr_26 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="26" data-gr-id="26">i</g> want.How do you insert data to <g class="gr_ gr_50 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="50" data-gr-id="50">database</g>?
If you use SQL, you could try to use:
INSERT INTO Consract(Id, ConsractStartDate,ConsractEndDate)VALUES(1, '2017/12/6',NULL);
How can <g class="gr_ gr_28 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="28" data-gr-id="28">i</g> use one <g class="gr_ gr_23 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="23" data-gr-id="23">calandar</g> and put the date in the Textbox?I think you could try to use <g class="gr_ gr_18 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="18" data-gr-id="18">datepicker</g>.
You could refer to the links below for tutorials of <g class="gr_ gr_20 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="20" data-gr-id="20">datepicker</g>:
https://jqueryui.com/datepicker/
http://bootstrap-datepicker.readthedocs.io/en/latest/
Best Regards,
Billy
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 6, 2017 8:05 AM
All replies
-
User2103319870 posted
f i don't enter any date in my text box , Can it be Null? not save the default date .You can have null value in DateTime column. Make the default value of DateTime column as null, so even if there is not value in insert query it will take the default value
ConsractStartDate DATETIME NULL DEFAULT NULL
Wednesday, December 6, 2017 3:13 AM -
User2103319870 posted
I have two Textbox for users to enter the Contract Start date and End date, I design a img-btn , when i click , Calandar will appear and can choose a date,How can i use one calandar and put the date in the Textbox?
You could take a look at Jquery DatePicker for calendar control in textbox
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Icon trigger</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#datepicker" ).datepicker({ showOn: "button", <!-- Change the image path as per your soluiton here --> buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif", buttonImageOnly: true, buttonText: "Select date" }); }); </script> </head> <body> <p>Date: <input type="text" id="datepicker"></p> </body> </html>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 6, 2017 3:15 AM -
User-335504541 posted
Hi <g class="gr_ gr_19 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="19" data-gr-id="19">PPetee</g>,
but no matter how <g class="gr_ gr_25 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="25" data-gr-id="25">i</g> tried, it will save data like this "1900/1/1 AM 12:00:00" ---> This is not what <g class="gr_ gr_26 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="26" data-gr-id="26">i</g> want.How do you insert data to <g class="gr_ gr_50 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="50" data-gr-id="50">database</g>?
If you use SQL, you could try to use:
INSERT INTO Consract(Id, ConsractStartDate,ConsractEndDate)VALUES(1, '2017/12/6',NULL);
How can <g class="gr_ gr_28 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="28" data-gr-id="28">i</g> use one <g class="gr_ gr_23 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="23" data-gr-id="23">calandar</g> and put the date in the Textbox?I think you could try to use <g class="gr_ gr_18 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="18" data-gr-id="18">datepicker</g>.
You could refer to the links below for tutorials of <g class="gr_ gr_20 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="20" data-gr-id="20">datepicker</g>:
https://jqueryui.com/datepicker/
http://bootstrap-datepicker.readthedocs.io/en/latest/
Best Regards,
Billy
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, December 6, 2017 8:05 AM