Laravel - Form Input - Multiple select for a one to many relationship

后端 未结 7 1005
情深已故
情深已故 2021-02-01 04:40

One of the requirements in an application that I am building is for a form input which takes in a varying number of items for a single field. For instance, sports that I play ar

7条回答
  •  天命终不由人
    2021-02-01 04:53

    My solution, it´s make with jquery-chosen and bootstrap, the id is for jquery chosen, tested and working, I had problems concatenating @foreach but now work with a double @foreach and double @if:

      

    this is the code por jquery chosen (the blade.php code doesn´t need this code to work)

        $(".chosen-tag").chosen({
      placeholder_text_multiple: "Selecciona alguna etiqueta",
      no_results_text: "No hay resultados para la busqueda",
      search_contains: true,
      width: '500px'
    });
    

提交回复
热议问题