I have created a jQuery to show or hide a datepicker image based on the condition that the value in the text box is a date. You can view my html and jQuery at this:
jsFiddle url . In my .aspx.cs page there is a fill method which populates date in the text boxes 'txtBox0', txtBox1, etc..
After the fill method has run, I would like the jQuery to check if the value in the text box is a date. I have just used the data type value 'D' in the example but I am not sure how you do that. Also, I am not sure how and if jQuery can detect data changed because the method runs only after page loads and user clicks on the 'Retrieve Query Date' button. I would appreciate any help. Thanks.
- $(document).ready(function() {
- $("#txtBox0").change (function() {
- if ($(this).val() =="D") {
- $("#DP0").hide();
- }
- else {
- $("#DP0").show();
- }
- });
- });