You are viewing limited content. For full access, please sign in.

Question

Question

Auto select date field in the collection

asked on May 27, 2017 Show version history

Hello Everybody,

I have a collection with multiple fields, one of them is Date field (class .collectionDate). How to force Datepicker dialog to open automatically when new row is added?

Thank you,

0 0

Answer

SELECTED ANSWER
replied on June 2, 2017

$(document).ready(function () {
    $('#q10 .cf-collection-append').on('click', picker);
    function picker() {
      if ($('#ui-datepicker-div').is(':visible'))
      {
        $('#ui-datepicker-div').hide();
      }
      $('.collectionDate img.ui-datepicker-trigger').last().click();
    }
});

 

"q10" should be changed to the id of the collection.

"collectionDate" is the class of the date field

if date is in table, change "cf-collection-append" to "cf-table-add-row"

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.