Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 480.8k

Boostrap form with edit values and save to the database

Nov 9 2021 2:02 PM

Hi Team

 

I want to create a form that has textbox, datepicker that allow user to edit date. All values should be stored to the record list on the database. Anyone who can help me. This what i have so far as a work around start.

 

      <div class="form-group">
                <label asp-for="Date_Created" class="control-label"></label>
                <input asp-for="Date_Created" id="datepicker" type="text" class="form-control" value="@DateTime.Now.ToString("yyyy-MM-ddThh:mm")" />
                <span asp-validation-for="Date_Created" class="text-danger"></span>
            </div>
            <script>
                $(document).ready(function () {
                    $(".datepicker").datepicker({
                        dateFormat: "dd-mm-yy",
                        changemonth: true,
                        changeyear: true
                    });
                });
            </script>

 

The datepicker is not working currently and its not loading as define datepicker as not function.


Answers (2)