Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Shopify Community Downtime: The Shopify Community will be down December 5th for 15 minutes between 3pm and 4pm EST. Thank you for your understanding.

Re: limiting # of characters in a line-item-property__field text field

Solved

limiting # of characters in a line-item-property__field text field

4cor
Tourist
8 0 1

Any suggestions on how to limit the number of characters in a text field?  looking to limit to 20 characters in the example:

<p class="line-item-property__field">
<label for="Heading">please enter a heading</label>
<input required id="the-heading" rows="1" cols="20" type="text" name="properties[Heading]">
</p>

 

thanks!

Accepted Solution (1)

LukaszFormela
Excursionist
37 7 15

This is an accepted solution.

Hi 4cor,

You may want to try the maxlength attribute for input:
https://www.w3schools.com/tags/att_input_maxlength.asp

 

Thanks,
Lukasz

Available for part-time theme edits/development | UK timezone

View solution in original post

Replies 2 (2)

LukaszFormela
Excursionist
37 7 15

This is an accepted solution.

Hi 4cor,

You may want to try the maxlength attribute for input:
https://www.w3schools.com/tags/att_input_maxlength.asp

 

Thanks,
Lukasz

Available for part-time theme edits/development | UK timezone
4cor
Tourist
8 0 1

Appreciate it!  We were trying to make a small adjustment and this small item was eluding us.