Making a text box required in Shopping Cart

Making a text box required in Shopping Cart

Colibricanada
Visitor
2 0 0

Help!  

I have added 4 text box fields to my shopping cart to collect a little more information from my customers and am having trouble making these text boxes a required field before moving into the Checkout.  

 

<div class="line-item-property__field">
<Form></Form><p class="line-item-property__field" style="width: 45%;">
<label for="Student's-name">Student's Name</label>
<input required class="required" id="Student's-name" type="text" name="properties[Student's-name]">
</p>
<p class="line-item-property__field" style="width: 45%;">
<label for="Teacher's-name">Teacher's Name</label>
<input required class="required"id="Teacher's Name" type="text" name="properties[Teacher's Name]">
</p>
</div>
<div class="line-item-property__field-group">
<p class="line-item-property__field" style="width: 60%;">
<label for="Grade">Grade</label>
<input required class="required" id="Grade" type="text" name="properties[Grade]">
</p>
<p class="line-item-property__field" style="width: 30%;">
<label for="School">School</label>
<input required class="required" id="School" type="text" name="properties[School]">
</p></form>
</div>
</div>

Replies 3 (3)

Made4uo-Ribe
Shopify Partner
6827 1629 2007

Hi @Colibricanada 

 

I did fix the code you provided. Please replace your code with the code below. Also, if you visit our website, you should be able to utilize our free Shopify UI generator tool.

 

 

<form>
  <div class="line-item-property__field">
    <p class="line-item-property__field" style="width: 45%;">
      <label for="students-name">Student's Name</label>
      <input required class="required" id="students-name" type="text" name="properties[Student's-name]" form="cart">
    </p>
    <p class="line-item-property__field" style="width: 45%;">
      <label for="teachers-name">Teacher's Name</label>
      <input required class="required" id="teachers-name" type="text" name="properties[Teacher's Name]" form="cart">
    </p>
  </div>
  <div class="line-item-property__field-group">
    <p class="line-item-property__field" style="width: 60%;">
      <label for="grade">Grade</label>
      <input required class="required" id="grade" type="text" name="properties[Grade]" form="cart">
    </p>
    <p class="line-item-property__field" style="width: 30%;">
      <label for="school">School</label>
      <input required class="required" id="school" type="text" name="properties[School]" form="cart">
    </p>
  </div>
</form>

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.
Colibricanada
Visitor
2 0 0

I am trying to add 4 customer notes fields or text boxes to my Taste Theme cart that will be required to checkout.  I will need the information from these boxes to show up on the order.  Any idea how I do this?  I can make the boxes show up in the cart but the information doesn't come through on the order and the customer can move into the checkout screen without filling these out.

 

KingNex
Tourist
3 0 1

Hey! I'm looking for the same result, did you ever figure it out?