Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

290
Views
tui.Calendar not working when I bind it to same id multiple time

I am using tui.Calendar to bind Date Picker in a model. and that model opens from different pages. The id of that textbox is the same because I am opening the same model. This Date picker is opening only on one page, not on another.

Below is the HTML

<div class="eventDate col-12 col-md-6 mt-3">
   <label class="control-label">Date</label><span class="text-danger">*</span>
   <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
   <input type="text" id="txtEventDate" aria-label="Date-Time">
   <span class="tui-ico-date"></span>
   <div class="clean-date" onclick="CleanDateTimeFromField('input#txtEventDate')">
      <i class="fas fa-times"></i></div>
   </div>
 <div id="txtEvent_DateWrapper" style="margin-top: -1px;"></div
</div>

Below one is calling from different page

eventDateCalendar = GenerateDatePicker('txtEventDate', 'txtEvent_DateWrapper', new Date(), false);

JS

function GenerateDatePicker(element, wrapper, value, timePicker) {
    var container = document.getElementById(wrapper);
    var target = document.getElementById(element);
    var d = new tui.DatePicker(container, {
        date: new Date(value),
        input: {
            element: target,
            format: timePicker ? 'MM/dd/yyyy HH:mm A' : 'MM/dd/yyyy'
        },
        timepicker: timePicker ? {
            layoutType: 'tab',
            inputType: 'spinbox'
        } : false
    });
    
    return d;
}

const CleanDateTimeFromField = (inputField) => {

    jQuery(inputField).val('');

};

Please solve this issue. I am using it in .net core application

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!