There is actually a problem with @ManseUK's solution; when the dialog is opened, and the user clicks on the textbox of the datepicker, it does not open the first time. This solution should work for all expected cases.
I'm not sure who the author is, but I found the solution on CleanCode.co.nz
HTML
<input type="button" value="Show Popup" id="button"/>
<div id="popup">
<div>
Date: <input type="text" id="datePicker3" >
</div>
<div>
Name: <input type="text" id="UserName">
</div>
</div>
jQuery
$(document).ready(function() {
$("#popup").dialog({
autoOpen: false,
resizable: false,
height: 300,
width: 400,
modal: true,
open: function() {
$('#datePicker3').removeAttr("disabled");
},
close: function () {
$('#datePicker3').datepicker('hide');
}
});
$("#datePicker3").datepicker();
$("#button").click(function() {
$('#datePicker3').attr("disabled", true);
$("#popup").dialog("open");
});
});
Working JSFiddle
*You need to enable jQuery UI, and click Run