0

My html binding code is:

<input class="input-large" name="EventDate" type="text" placeholder="" tabindex="" required data-bind="datepicker: EventDate, datepickerOptions: { changeMonth: false, changeYear: false, numberOfMonths: 1, showButtonPanel: true, dateFormat: 'd MM, yy', autoSize: true, prevText: 'Earlier', minDate: new Date(), showAnim: 'fold' }" /> 

How can i set the value into EventDate = ko.observable() using knockout js view model.

1
  • Your goal is unclear. Please give a fuller explanation. Commented Dec 14, 2013 at 15:40

1 Answer 1

0

Just create an observable in a view model -

function viewModel() { var self = this; self.EventDate = ko.observable(); } ko.applyBindings(new viewModel()); 

And call that in a document ready event handler of some sort.

You need to make sure to have a datepicker custom binding handler registered also.

Sign up to request clarification or add additional context in comments.

1 Comment

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.