Skip Navigation

[Resolved] Changing input type from 'text' to 'search'

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by stephenR 4 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1641651

Hi. I have this filter:-

[wpv-filter-search-box placeholder="Search products" output="bootstrap"][wpv-filter-submit output="bootstrap" name="Go"]

which outputs this html for the input field:-

<input type="text" name="wpv_post_search" class="js-wpv-filter-trigger-delayed form-control" placeholder="Search products">

But I want a search field instead of a text field like this:-

<input type="search" name="wpv_post_search" class="js-wpv-filter-trigger-delayed form-control" placeholder="Search products">

Can you please tell me how to do that?

Thanks
Steve

#1642573

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The only way you can change the type attribute of your input field is using the jQuery.

For example - please try to add teh following JS code to your "search and pagination" section's JS editor:

jQuery(document).ready(function($){

  $("input[name='wpv_post_search']").attr("type","search");

});
#1642881

That's fixed it. Thanks Minesh.