mercredi 19 juillet 2017

Dynamic form submission in laravel 5 - using selected id.

This is my rendered form in laravel

<form class="danger-zone" method="POST" action="/client/">

    <input type="hidden" name="_method" value="delete">
      <input type="hidden" name="_token" value="Ai5xkfgjVzOw0mNuhPgPTzyuk3EDqYmjXMArDdlZ">
    <h3>Delete client </h3>
    <p>This will delete the client permanently</p>

     <select>
            <option>Please Select</option>
                     <option value="49">Johns's boxes</option>
                     <option value="50">Caro's Coffee</option>         
        </select>
     <button class="btn btn-danger danger-zone__btn">Delete client</button>

    </form>

The problem I am having is the action on the form should be

/client/

I am using restful resource controllers.

Is there a way to achieve this without using listening for the select change with javascript and amending the action path OR using ajax?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2u9SLvP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire