views:

26

answers:

1

Hi All,

Is it possible to disable the input textbox at which I attached my datepicker and only allow input by clicking the button/icon panel of the Jquery UI datepicker.

$(function(){
    var opt = {
        buttonImage: "images/cal.png",
        buttonImageOnly: true
    };
    $("#date").datepicker(opt);
});

What I mean is, the icon is there but user could still type in an invalid date. Say my format is "mm/dd/yyyy", but I could just type in and set it to 16/10/2010.

I used the jquery validation and jquery masked input plugin in conjunction but they still accept both value.

I dont want my server side code to catch up this but rather I wanted to trap it using javascript as much as possible although I setup a checking on my Spring MVC also.

Is this possible? Thanks

+2  A: 

You can make your input textbox readonly.

Parkyprg
@Parkyprg... makes really sense... I should have not ask this question... thank you..
Mark Estrada