Get list of selected items from html form when we have two from in django app

hello i have two html from for selcting categories one for desktop view and other one for mobile view both of them have get method mt problem is in the mobile view when i select a category its work at start but when i want to select another one its not

its html form for mobile view :

<form action="{% url 'shop:category' %}" method="get">
{% for cat in categories %}
    <div class="d-flex align-items-center justify-content-between flex-wrap mb-3">
        <div class="form-check">
            <label for="category_{{ cat.id }}"
                   class="form-check-label">{{ cat.name }} </label>
            <!-- Correctly use the same name and ensure it's an array to hold multiple values -->
            <input type="checkbox" name="categories"
                   id="category_{{ cat.id }}" value="{{ cat.id }}"
                   class="form-check-input"
                   {% if cat.id|stringformat:"s" in selected_categories %}checked{% endif %}>
        </div>
        <div>
            <span class="fw-bold font-14">( {{ cat.product_numbers }} )</span>
        </div>
    </div>
{% endfor %}
<div class="filter-item text-center">
    <button type="submit" class="btn-outline-site">اعمال فیلتر</button>
</div>

and this is for desktop view :

<form action="{% url 'shop:category' %}">
    {% for cat in categories %}
        <div class="d-flex align-items-center justify-content-between flex-wrap mb-3">
            <div class="form-check">
                <label for="colorCheck11"
                       class="form-check-label">{{ cat.name }} </label>
                <label for="category_{{ cat.id }}"></label><input type="checkbox"
                                                                  name="categories"
                                                                  id="category_{{ cat.id }}"
                                                                  value="{{ cat.id }}"
                                                                  class="form-check-input">
            </div>
            <div>
                <span class="fw-bold font-14">( {{ cat.product_numbers }} )</span>
            </div>
        </div>
    {% endfor %}
    <div class="filter-item text-center">
        <button type="submit" href="" class="btn-outline-site">اعمال فیلتر</button>
    </div>
</form>

desktop form works fine but mobile form not :

i use a view to get the list of this categori ids in my django app :

def product_filter_by_categories(request):
    selected_categories = request.GET.getlist('categories')

when i am using mobile form and i select a category or categories it works fine but when i select another catories selected_categories in this view will be an empty list

Back to Top