Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Flex's avatar
Level 4

not save bootstrap date value to tha DB table

using bootstrap date picker in My form to save date value in the controller

 public function store(Request $request)
    {
       

        $task = new Task;
        $task->task_name   = $request->input('name');
        $task->body = $request->input('body');
        $task->assign          = $request->input('status');
        $task->priority        = $request->input('status');
        $task->duedate  = $request->input('date');
        $task->save();
        
    }

this is form date picker

 <div class="col-xs-3">
       <div class="input-group">
        <div class="input-group-addon">
         <i class="fa fa-calendar">
         </i>
        </div>
        <input class="form-control" id="date" name="date" placeholder="MM/DD/YYYY" type="text"/>
       </div>
      </div>

this is jquery function regarding with bootstrap date picker in app.blade.php

 <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <!-- Bootstrap Date-Picker Plugin -->
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
    <script>
    $(document).ready(function(){
      var date_input=$('input[name="date"]'); //our date input has the name "date"
      var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
      var options={
        format: 'mm/dd/yyyy',
        container: container,
        todayHighlight: true,
        autoclose: true,
      };
      date_input.datepicker(options);
    })
    </script>

save other form date without date value in My table duedate column save with 0000-00-00 values how can solve this?

0 likes
1 reply
Flex's avatar
Level 4

is this jquery problem?

Please or to participate in this conversation.