Then, create a TextBox control in your webpage,refer to the download file with jquery-ui.min.css and jquery-ui.min.js to ensure your webpage can use Datepicker plug-in.
Noted that we should refer to a jquery file before you refer the Datepicker plug-in.
Finally, call the Datepicker plug-in with jquery,then the calender will pop up under the TextBox control.
For more details, you could refer to the following code:
Member
171 Points
354 Posts
Pop up calender in vb.net
Jun 11, 2019 03:02 AM|shsu|LINK
I am using below code for the pop up calendar. In my UPDATE COMMAND(VB.NET),I want to use the html textbox (from_filter) value.
ACTUALLY Delproof.Text is a asp.net text box. I want to use html textbox instead of Delproof.Text. how can I modify the code. Thanks
cmd.CommandText = "update XXTEC_TSS_SHIP_ORDER_HDR_IF set POD_DATE=TO_DATE('" + Delproof.Text + "','mm/dd/yy') where ID ='" + de.Text + "'
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<div class="col-md-4">
<span>From</span>
<div class="replay-in">
<input type="text" name="" value="" placeholder="04/03/2017" class="form_date" id='from_filter'>
<span class="glyphicon glyphicon-calendar from_icon " style="padding-right: 6px">icon</span>
</div>
</div>
<div class="col-md-4">
<span>To</span>
<div class="replay-in">
<input type="text" name="" value="" placeholder="04/03/2018" class='to_filter' id='to_filter'>
<span class="glyphicon glyphicon-calendar to_icon" style="padding-right: 6px">icon</span>
</div>
</div>
<script>
$( function() {
//today=new Date(1000*today);
var dateFormat = "mm/dd/yy",
from = $("#from_filter")
.datepicker({
defaultDate: "+0w",
changeMonth: false,
numberOfMonths: 1
})
.on( "change", function() {
to.datepicker( "option", "minDate", getDate( this ) );
}),
to = $( "#to_filter" ).datepicker({
defaultDate: "+0w",
changeMonth: false,
numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = NULL;
}
return date;
}
} );
$('.from_icon').click(function(){
$("#from_filter").datepicker("show");
});
$('.to_icon').click(function(){
$("#to_filter").datepicker("show");
});
</script>
Thanks
Contributor
2820 Points
803 Posts
Re: Pop up calender in vb.net
Jun 11, 2019 08:02 AM|Yongqing Yu|LINK
Hi shsu,
According to your requirement, I suggest you could choose Datepicker plug-in with jquery in your webpage.
You could refer to this tutorial on this plug-in from this link: https://jqueryui.com/datepicker/
First, download the latest version of this plug-in from this link: https://jqueryui.com/download/all/
Then, create a TextBox control in your webpage,refer to the download file with jquery-ui.min.css and jquery-ui.min.js to ensure your webpage can use Datepicker plug-in.
Noted that we should refer to a jquery file before you refer the Datepicker plug-in.
Finally, call the Datepicker plug-in with jquery,then the calender will pop up under the TextBox control.
For more details, you could refer to the following code:
The result of my work demo:
Best Regards,
YongQing.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
171 Points
354 Posts
Re: Pop up calender in vb.net
Jun 26, 2019 07:35 AM|shsu|LINK
Thanks you
Is it possible to add time also in this calendar.