vendredi 25 septembre 2015

Laravel 5 - Handling multiple forms on a single page

I have a page with a select option

<div class="col-md-7">
    <select class="selection" name="selection">
        <option value="ab">Form One</option>
        <option value="ad">Form Two</option>
        <option value="nq">Form Three</option>
    </select>
</div>

<div id="content"></div>

For my JQuery, I just listen for the change

$(".selection").on("change", function(e){
    if($(this).val() == "ad"){
        $("#content").append(data);
    }
});

Now where this blade template lives (resources/views/customer), I have created a forms folder. In this folder are form1.blade.php and two more templates for the other forms.

How would I go about added the form template into the div with the id content?

Or is there a better way of handling multiple forms for a single page?

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire