Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have following code to validate date but its not working

JavaScript
 var GetModelData = function (data) {
self.EventDateTime = ko.observable(data.EventDateTime).extend({
            required: { params: true, message: "What's the date of the event?" }
        });
  };


JavaScript
 <div class="input-group date">
   <input type='text' placeholder="Event Date" data-toggle="tooltip"
     data-original-title="Event Date is Required"
     id="eventDateTimePicker" class="form-control"                                                   data-date-format="DD/MM/YYYY hh:mm A"  data-bind="validationOptions: {  errorElementClass: 'validation_errormsg' }" />
<span class="input-group-addon">
 <span class="glyphicon glyphicon-calendar"></span>
 </span>
<span data-bind="validationMessage: EventDateTime" class="app--validation--error-message"></span>
</div>


thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900