[Vuejs]-ID is undefined when using a radio input field – Vue JS

0👍

Found the issue,

Tried to use onchange event method but the issue is still the same but when I looked in the radio tag I don’t have a name attribute set.

After adding the name attribute it finally solves the issue.
For now I don’t have any idea how the simple name attribute brakes my script.

 <div class="cell large-6">
                    <ul class="product_category_selections">
                        {% graphql industry_list = 'get_homepage_industry_list' %}
                        {% for industry_item in industry_list.items.results %}
                            <li>
                                <label>
                                    <input type="radio" name="selected_industry_name" id="{{ industry_item.id }}" value="{{ industry_item.id }}" v-model="selected_industry" /> {{ industry_item.properties.name }}
                                </label>
                            </li>
                        {% endfor %}
                        <input type="text" v-model="selected_industry" name="form[properties_attributes][industry]" />
                    </ul>
                </div>

screenshot: https://cbo.d.pr/ZWox9k

Leave a comment