Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

291
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda