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

162
Views
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 answers
Answer question

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 Report
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!