Solved

How can I limit the character count in the note to seller on Turbo theme?

Jrichardsonxx
Tourist
9 0 4

Can you advise me how to limit number of characters to in note to seller? Customers are writing very long gift messages that we can't fit on our cards! I'm using Turbo theme.
Appreciate any help,
Jess

Accepted Solution (1)
Ninthony
Shopify Partner
2330 350 1024

This is an accepted solution.

So two approaches you can take here. Open your cart-template.liquid file in your assets folder. Ctrl + f and search for "note" -- look until you find something that looks like this:

<textarea id="note" name="note" rows="2" class=""></textarea>

 

Then add the maxlength attribute to it:

<textarea id="note" name="note" rows="2" class="" maxlength="50"></textarea>

 

If you can't figure that out, you can put this in theme.liquid right before the closing body tag (</body>):


<script>
$(function (){
$('#note').attr('maxlength','50');
})

</script>

 

Just change 50 to however many characters you want to allow in any instance.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄

View solution in original post

Replies 6 (6)

KetanKumar
Shopify Partner
36843 3636 11978

@Jrichardsonxx 

sorry for this issue can you please try this similar 

https://www.w3schools.com/tags/att_textarea_maxlength.asp

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Jrichardsonxx
Tourist
9 0 4

Do you have any more information in applying this solution to Turbo theme?

Many thanks,

Jess

Ninthony
Shopify Partner
2330 350 1024

We dont have access to Turbo theme as it's paid. You'll have to locate the text input that the cart note goes into in your cart template and add a max-length property as provided by @KetanKumar. If you can provide your store url and password if password protected (Online Store > Preferences > Password Protection), we may be able to guide you how to make the change.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
Jrichardsonxx
Tourist
9 0 4

That makes sense.

https://tugboat.co.uk/

Many thanks, 

Jess

Ninthony
Shopify Partner
2330 350 1024

This is an accepted solution.

So two approaches you can take here. Open your cart-template.liquid file in your assets folder. Ctrl + f and search for "note" -- look until you find something that looks like this:

<textarea id="note" name="note" rows="2" class=""></textarea>

 

Then add the maxlength attribute to it:

<textarea id="note" name="note" rows="2" class="" maxlength="50"></textarea>

 

If you can't figure that out, you can put this in theme.liquid right before the closing body tag (</body>):


<script>
$(function (){
$('#note').attr('maxlength','50');
})

</script>

 

Just change 50 to however many characters you want to allow in any instance.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
Jrichardsonxx
Tourist
9 0 4

That worked a treat.

Much appreciate the help!

Jess