How can I insert a placeholder in a custom liquid textbox?

Solved

How can I insert a placeholder in a custom liquid textbox?

ScanMe
Shopify Partner
15 0 1

Hi, i have a section with this custom liquid code to add a textbox, but I want to put a placeholder in the textbox and I can't. Can anyone help me?

ScanMe_0-1707095903304.png

 



custom liquid code: 
<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top:0}.custom .field__input{padding-top:0.8rem}</style>
<label class="form__label custom" for="insert-a-link-to-connect-to-your-qr-code:">Insert a link to connect to your QR-Code:</label>
<div class="field custom">
<input class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="insert-a-link-to-connect-to-your-qr-code:" name="properties[Insert a link to connect to your QR-Code:]" required>
<script>
document.addEventListener("DOMContentLoaded", ()=>{document.querySelector("form[novalidate]").removeAttribute("novalidate")})
</script>
</div>

Accepted Solution (1)

Vinsinfo
Shopify Partner
486 165 169

This is an accepted solution.

Please use below code in style tag,

.field.custom input.field__input::placeholder {
    opacity: 1;
}

 

Please add placeholder attribute like below,

<input placeholder="Enter text here..." class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="insert-a-link-to-connect-to-your-qr-code:" name="properties[Insert a link to connect to your QR-Code:]" required>

 

priyavinsinfo_1-1707142041649.png

 

Please let me know whether it is useful for you.

 

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support

View solution in original post

Replies 5 (5)

PageFly-Richard
Shopify Partner
4991 1117 1796

Hi @ScanMe 

This is Richard from PageFly - Shopify Page Builder App

 

You will need to add the placeholder attribute to the input, to get this solved

To change the input like this

<input placeholder="Test Placeholder here..." class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="insert-a-link-to-connect-to-your-qr-code:" name="properties[Insert a link to connect to your QR-Code:]" required>

 

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.

ScanMe
Shopify Partner
15 0 1

It did not work,
the code should be like this right? 

<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top:0}.custom .field__input{padding-top:0.8rem}</style>
<label class="form__label custom" for="insert-a-link-to-connect-to-your-qr-code:">Insert a link to connect to your QR-Code:</label>
<div class="field custom">
<input placeholder="Test Placeholder here..." class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="insert-a-link-to-connect-to-your-qr-code:" name="properties[Insert a link to connect to your QR-Code:]" required>
<script>
document.addEventListener("DOMContentLoaded", ()=>{document.querySelector("form[novalidate]").removeAttribute("novalidate")})
</script>
</div>

ssdc
Shopify Partner
32 1 7

try a simple input field first. like

<input type="text" name="firstname" placeholder="First name">

 

see if that works

Shopify Expert based in Indonesia. Visit our website ssdc.co

Vinsinfo
Shopify Partner
486 165 169

This is an accepted solution.

Please use below code in style tag,

.field.custom input.field__input::placeholder {
    opacity: 1;
}

 

Please add placeholder attribute like below,

<input placeholder="Enter text here..." class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="insert-a-link-to-connect-to-your-qr-code:" name="properties[Insert a link to connect to your QR-Code:]" required>

 

priyavinsinfo_1-1707142041649.png

 

Please let me know whether it is useful for you.

 

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
ScanMe
Shopify Partner
15 0 1

you are a legend mate, thank you so much