Embedding control tags into radio buttons

I’m new to coding and I really, really, hope that someone can help me with this issue. I’m trying to add a condition to a radio button. I know how to add all of the elements, I’m just having a hard time with making them interact with each other. These are the commands that I’m trying to enable.

When no button is selected, display nothing.
When option-1 is selected, display text___1 along with an upload option.
When option-2 is selected, display text___2 along with a text box.

Thanks in advance!

Latwunia Williams

Can you give us an example of the HTML you are using for this? Depending on how that’s configured you might be able to use the CSS :checked pseudo-class to do this. Otherwise, you would use javascript.

Thank you for responding. You can find an example of the radio buttons below that I’ve set up. I’ve also attached images of what I’m trying to achieve. Thank you in advance!

<!-- start code for custom product options --> 
                  
                {% if product.template_suffix == 'custom' %}
                    <p class="line-item-property__field">
                      <label>Step 1: Choose your style</label><br>
                      <input required class="required" type="radio" name="properties[Step 1: Choose your style]" value="My Own Handwriting"> <span>My Own Handwriting</span><br>
                      <input required class="required" type="radio" name="properties[Step 1: Choose your style]" value="Handwriting Font"> <span>Handwriting Font</span><br>
                    </p>
 				{% endif %}   
                  
<!-- end code for custom product options -->                  
{% if section.input=="radio" and value=="My Own Handwriting" %}
 Option 1 is selected                                                                                           
 {% endif %}                 
                  
 

I’m not familiar with this syntax so I don’t know what you are using to create the HTML and thus probably can’t help you. Maybe someone else around here will know this.

Also, you might get better help if you add the language you are using to the title (e.g. “Embedding control tags into radio buttons in [whatever language you are using]”).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.