How to modify a form on Symfony

so I’m creating an e-commerce website using symfony and twig. Right now The client can enter manually the quantity he wants of a specific product, but i want that quantity to not exceed the stock we have of that product. So for example if we have 5 chairs, i want him to choose between 1 and 5.
For that i created a dropdown :

 <div class="field select-box">
                            <select name="quantity" data-placeholder="Select your quantity">

                               {% for i in 1..produit.stock %}
                                   <option  value="{{ i }}" >{{ i }}</option>
                         
                                    {% endfor %}
                            </select>
                        </div>

I want to use the selected value to put it inside a form,, or maybe find another way to set the quantity asked without using the form or even just change the way the form looks because right now it only takes input. Should i generate another form ?

Hopefully i was clear.

Here’s what my formType looks like :

class ContenuPanierType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder->add('quantite');

     
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => ContenuPanier::class,
        ]);
    }
}