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

  • Home
  • SEARCH
  • 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 8991145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:39:32+00:00 2026-06-15T22:39:32+00:00

I used a knockout.js templatescript to create a form that can be duplicated and

  • 0

I used a knockout.js templatescript to create a form that can be duplicated and deleted. The fiddle can be found here.

I editted the script with a litle help from SE to add a jquery-ui datepicker. The short version of the fiddle can be found [here][2]. So far so good, but when testing i found out that everything works in any browser, except for IExplorer (various versions).

The problem is in this specific part, but i have no clue where.

script type='text/javascript'>//<![CDATA[ 
ko.bindingHandlers.datepicker = {
    init: function (element, valueAccessor, allBindingsAccessor) {
        var options = allBindingsAccessor().datepickerOptions || {};

        console.log("datepicker");                        
        $(element).datepicker(options);

        //handle the field changing
        ko.utils.registerEventHandler(element, "change", function () {
            var observable = valueAccessor();
            observable($(element).datepicker("getDate"));
        });

        //handle disposal (if KO removes by the template binding)
        ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
            $(element).datepicker("destroy");
        });

    }
};

Also now we’re at it. The datepicker doesn’t close when you click outside the box. This happens in any browser.

Additional questions

  1. I use this (and many others) to autocorrect a field. In this case uppercase the input. This works excellent on the first form. But not on any duplicate forms.

    $(“.hoofdletters”).keyup(function(e)
    {
    $(“.hoofdletters”).val(($(“.hoofdletters”).val()).toUpperCase());
    });

  2. When i use uniqueName: true, every field (also duplicated forms) will get validated. But my $_POST names are all renamed. I would like the originall field names, for example year[] instead of ko_unique_1. Works when removing uniqueName, but then the duplicated forms don’t validate anymore.

    [2]: http://jsfiddle.net/QUxyy/5/enter code here

  • 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-06-15T22:39:34+00:00Added an answer on June 15, 2026 at 10:39 pm
    1. To make the code work on IE: Remove “console.log” instruction
    2. To change the date format, you can define a binding like this one:

      data-bind=’datepicker: beschikkingsdatum, datepickerOptions: {dateFormat: “dd/mm/yy”}, uniqueName: true’

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

Sidebar

Related Questions

I've used Backbone.js, I've learned about Knockout.js; however, now I found out about Knockback.js.
I used TOAD for oracle 11g, I want to create an insert script from
The question: How can I structure my code so that the knockout bindings are
I am trying to setup generic Knockout templates that can be toggled between edit
Used code I found on SO to use the COM based Acrobat Reader to
I used the phonegap website to create an IPA file. Now I want to
Having used storyboards for a while now I have found them extremely useful however,
i used this code: List<string> lists=new List<string>(apple,orange,banana,apple,mang0,orange); string names; names=lists.Distinct() is that correct?
I started to play around with knockout.js and in doing so I used the
I have a search form & knockout-based grid for results. When search is performed,

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.