Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda