Jump to content

Custom Text In Search Bar

Recommended Posts

  • Replies 9
  • Views 998
  • Created
  • Last Reply
  • 2 months later...
8 hours ago, cherylr said:

I am trying to do this as well.

Here's a link to my site: https://mark-russell-o43o.squarespace.com/

Add to Code Injection Footer

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('.sqs-search-page-input input').attr('placeholder','Tuan Tuan Tuan Tuan Tuan');
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 month later...

Worked for me. For Avenue template I had to use a slightly different class

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('.sqs-search-ui-text-input input').attr('placeholder','Buscar');
</script>

 

Link to comment
  • 1 month later...
On 2/2/2020 at 7:30 PM, tuanphan said:

Add to Code Injection Footer


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('.sqs-search-page-input input').attr('placeholder','Tuan Tuan Tuan Tuan Tuan');
</script>

 

Hi Tuan!

I am also looking to do this, however my pages will have multiple search boxes that all need to have different display text. For example, the left one could say "Search by Neighborhood" and the right one could be "Search by Address". How can I target them individually? I assume I need to reference the yui ids, but I'm not exactly sure how to tackle that. Maybe you can help? Please and thank you!

The url is https://crocodile-pigeon-9mmr.squarespace.com/scratch

 

Link to comment
21 hours ago, PrismaVisual said:

Hi Tuan!

I am also looking to do this, however my pages will have multiple search boxes that all need to have different display text. For example, the left one could say "Search by Neighborhood" and the right one could be "Search by Address". How can I target them individually? I assume I need to reference the yui ids, but I'm not exactly sure how to tackle that. Maybe you can help? Please and thank you!

The url is https://crocodile-pigeon-9mmr.squarespace.com/scratch

 

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('div#block-yui_3_17_2_1_1588863336914_16498 .sqs-search-page-input input').attr('placeholder','Search mot');
  $('div#block-yui_3_17_2_1_1588863336914_18386 .sqs-search-page-input input').attr('placeholder','Search hai');
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 5/8/2020 at 10:28 AM, tuanphan said:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('div#block-yui_3_17_2_1_1588863336914_16498 .sqs-search-page-input input').attr('placeholder','Search mot');
  $('div#block-yui_3_17_2_1_1588863336914_18386 .sqs-search-page-input input').attr('placeholder','Search hai');
</script>

 

Thanks so much Tuan! However I've not been able to get this to work. 😞  The content has since been relocated. I did identify and target the new block yui id's but nothing happens. The new environment is 7.1 (it was formerly 7.0) maybe that's why? Does this script have to go somewhere other than the Code Injection Footer when working in 7.1?

The new url is:  https://tomato-lynx-pzwm.squarespace.com/

password: bennythejet

Link to comment
21 hours ago, PrismaVisual said:

Thanks so much Tuan! However I've not been able to get this to work. 😞  The content has since been relocated. I did identify and target the new block yui id's but nothing happens. The new environment is 7.1 (it was formerly 7.0) maybe that's why? Does this script have to go somewhere other than the Code Injection Footer when working in 7.1?

The new url is:  https://tomato-lynx-pzwm.squarespace.com/

password: bennythejet

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('div#block-yui_3_17_2_1_1589218491243_29604 input').attr('placeholder','Search mot');
  $('div#block-yui_3_17_2_1_1588964900710_39076 input').attr('placeholder','Search hai');
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.