Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:41:57+00:00 2026-05-28T00:41:57+00:00

I am using Knockout JS library to bind the HTML5 input controls in my

  • 0

I am using Knockout JS library to bind the HTML5 input controls in my Web application which is intended to run on iPad (iOS5, Safari 5.1). The binding works fine for the input types like text and select but not for date. After selecting a date value through the datepicker the value is not getting bound to the viewModel property (in effect not getting saved).

This is how my HTML looks.

<input id="dob" name="dob" type="date" data-bind="value: dob" />

I tried to work around with a custom binding where I initialized a change event handler.

ko.bindingHandlers.datePicker = {
    init: function (element, valueAccessor) {
        ko.utils.registerEventHandler(element, "change", function () {
            var observable = valueAccessor();
            observable($(element).val());
        });
    },
    update: function (element, valueAccessor) {
        var value = ko.utils.unwrapObservable(valueAccessor());
        $(element).val(value);
    }
};

Changing the HTML code to –

<input id="dob" name="dob" type="date" data-bind="datePicker: dob" />

Strangely, even that event is not firing. Please note that in both of the scenarios the binding happens perfectly in Windows XP on Opera and Safari browsers.

Ultimately, I got the solution to my problem by using the ‘blur’ event instead of ‘change’ in the custom binding. Now the event handler is being called and I am manually setting the value from the date control.

Now my question is, is it something that I am not doing correctly and if not then why doesn’t the change event of the HTML5 date control not fire, whether by default or through custom binding? I want the date control to work as it is supposed to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:41:58+00:00Added an answer on May 28, 2026 at 12:41 am

    You are not doing anything wrong from a Knockout perspective. Those events really just are not fired (without Knockout even in the picture) from what I can tell by testing and by researching it a bit.

    You can avoid a custom binding by doing:

    <input type="date" data-bind="value: myDate, valueUpdate: 'blur'" />

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Knockout javascript library, and I run into this problem: I am
I'm using knockout (awesome library), but I've run into a problem with templates: the
I am using Knockout-JS to bind properties in my view to my view model.
I've recently been using Steve Sanderson's knockout js library http://knockoutjs.com/ in my client side
What factors should I consider before adopting the Knockout JavaScript library for my application?
Does anyone know of an example application using knockout js and MVC 2? I'm
I'm working with a new application at work that we're building out using Knockout.js
Using knockout.js, is it possible to bind to a property of a child object
I am working with the wonderful Knockout.js library. I am using javascript classes to
I am trying to populate Select using knockout data-bind option for a list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.