When I make my datepicker read-only, I see that the user cannot type anything into the text box.
$(\"#datepicker\").attr(\'readonly\', \'readonly\');
I came up with another solution that is different than what had been proposed. When the date picker is used, it creates a div similar to a pop-up that is positioned when the input field is clicked on. To remove it, I just set the visibility property of the CSS so that it doesn't show up.
if ($('.yourDatepickerSelector').prop('readonly')) {
$('#ui-datepicker-div').css({ 'visibility': 'hidden' })
} else { $('#ui-datepicker-div').css({ 'visibility': 'visible' }) }
This also seems to post correctly to the server, and should not effect any of the settings associated with it.
<sj:datepicker id="datepickerid" name="datepickername" displayFormat="%{formatDateJsp}" readonly="true"/>
Works for me.