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

163
Visualizações
DatePicker doesn't bind value in Blazor

I'm using date picker in my component to bind the value to my method in blazor. the value is always empty.

Here is my component :

  <input data-provide="datepicker" class="col-sm-2 form-control" @bind="date_selected" data-date-format="yyyy-mm-dd"
        style="width: 300x ;height:35px;">

code{
    string date_selected;


    public async Task GetTags()
    {
        AllTags = await Task.Run(() => tagsService.Map( date_selected));

    }

}

my java script :



$( document ).ready(function() {
    $("#from-datepicker").datepicker({ 
        format: 'yyyy-mm-dd HH:mm:ss'
    });
    $("#from-datepicker").on("change", function () {
        var fromdate = $(this).val();
        alert(fromdate);
    });
}); 


Do you have any idea why I can't get the values and how can I solve it ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'm not sure what you're trying to achieve, but I suppose you can do it with pure Blazor. Maybe something like:

<input type="date" @onchange=HandledateChange />
<div>You selected: @date</div>

@code {
    string date = "";

    async Task HandledateChange(ChangeEventArgs args)
    {
        date = args.Value.ToString();
    }
}
about 4 years ago · Juan Pablo Isaza Relatório
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