How can I get the value of an input in twig and reuse in an url that exists in the same page twig without the use jquery

110 views Asked by At
<div class="product-btns">
    <div class="qty-input">
        <span class="text-uppercase">QTY: </span>
        <input name="quantite" class="input" type="number">
    </div>

    {% if app.user != null %}

    <a id="test" href="{{path('commande'{'id_product':listProduct.id ,'id_user':app.user.id,'quantite': })}}" class="primary-btn add-to-cart">
        <i class="fa fa-shopping-cart"></i>
        Add to Cart
    </a>
    {% else %}

I want to get value of input name="quantite" and reuse in path of parameter 'quantite'.

1

There are 1 answers

0
David Jungman On

Have you tried ?

{{ form.vars.value.quantite }}