Skip Navigation

[Resolved] [wpv-control-distance] appears to add a to the HTML. Trying to remove it.

This support ticket is created 4 years, 3 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 11 replies, has 3 voices.

Last updated by Jonathon Hanten 4 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1796863

Tell us what you are trying to do? I built out a simple event page with a Distance Filter. It all works, but the HTML has a <br> that I can't find anywhere in my code.

Is there any documentation that you are following? I used some of the instructions for the Realtor site.

Is there a similar example that we can see? Not off the top of my head but you can see it in action at this url.

What is the link to your site? hidden link

Here is my Search and Pagination block.

[wpv-filter-start hide="false"][wpv-filter-controls]<div class="filter-controls">[wpv-filter-spinner spinner="<em><u>hidden link</u></em>"][/wpv-filter-spinner][wpv-control-distance default_unit="mi" compare_field="physical-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit"]</div>[/wpv-filter-controls][wpv-filter-end]

I tried adding in the inputs_placeholder="Something else" to change the words as noted in this topic https://toolset.com/forums/topic/style-distance-filter/ but that just took the whole feature away so I guess that doesn't work.

Here is the HTML the site is producing with the <br>

<div class="form-group">Show results within             <input type="number" min="0" id="toolset-maps-distance-value" name="toolset_maps_distance_radius" class="form-control js-toolset-maps-distance-value js-wpv-filter-trigger" value="5" required=""><br>
            <select class="js-toolset-maps-distance-unit form-control js-wpv-filter-trigger" name="toolset_maps_distance_unit" id="toolset-maps-distance"><option value="km">km</option><option value="mi" selected="selected">mi</option></select> of             <input type="text" min="0" id="toolset-maps-distance-center" name="toolset_maps_distance_center" class="form-control js-toolset-maps-distance-center js-wpv-filter-trigger-delayed js-toolset-maps-address-autocomplete pac-target-input" value="" placeholder="Show Results" autocomplete="off"><input type="button" class="btn js-toolset-maps-distance-current-location" value="Use My Location" style="font: normal normal normal 14px/1 FontAwesome;"></div>

Help.

#1796977

I was able to correct my issue with inputs_placeholder= with a bit of CSS and finding other examples in the support tickets but I have not been able to find anything that would add the <br>. I think it might be hard coded in the filter code Toolset generates. Any suggestions on where to look next would be greatly appreciated. I would really like my filter to be on one line as intended.

#1797635

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I checked on my own site and I don't see the br tag, the complete markup for the distance filter is as shown here:

<div class="form-group">Show results within 
    <input type="number" min="0" id="toolset-maps-distance-value"
        name="toolset_maps_distance_radius" class="form-control js-toolset-maps-distance-value js-wpv-filter-trigger"
        value="5" required="">
    <select class="js-toolset-maps-distance-unit form-control js-wpv-filter-trigger" name="toolset_maps_distance_unit"
        id="toolset-maps-distance">
        <option value="km" selected="selected">km</option>
        <option value="mi">mi</option>
    </select> 
    of 
    <input type="text" min="0" id="toolset-maps-distance-center" name="toolset_maps_distance_center"
        class="form-control js-toolset-maps-distance-center js-wpv-filter-trigger-delayed js-toolset-maps-address-autocomplete pac-target-input"
        value="" placeholder="Enter a location" autocomplete="off">
</div>

I'm using Maps with Blocks, are you doing the same? Perhaps you could include your debug info (hidden link) in the next reply.

If not, can you confirm how and where you are inserting the View?

Also, does the br appear if you disable non-Toolset plugins and switch theme to twentytwenty?

#1797845

I have disabled all plugins except Toolset and changed to the 2020 Default theme and the <br> is still in the code. I don't believe the distance feature would work without Toolset Maps.

I have the following Toolset plugins, Types, Block, Maps, Access, Modules, and Forms

I would be happy to provide debug info but I didn't see an option to do that privately.

The view is placed inside an archive page

Can you point me to where the code is that generates from the shortcode so I can look at my copy to see if it has been adjusted?

I can also state that it view looks fine in the block editor, but the <BR> is only showing on the Front end.

Thanks

#1798035

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jonathon,

I took a look at this and you should be able to remove this by adding the jQuery below to your view.

jQuery( document ).ready(function() {
jQuery('.form-group').find('br').remove();
});

Please let me know if this helps.
Thanks,
Shane

#1798037

That does work, but I still would like to know where that <br> is coming from.

#1798045

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jonathon,

The <br> tag seems to be generated automatically by the
[wpv-control-distance default_unit="mi" compare_field="physical-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit"]

Shortcode.

I cant think of any other reason why the BR tag is added given that you've disabled the non-toolset plugins as well as switched to the 2020 default theme.

I can also confirm that this doesn't appear for me when I test on my end.

Thanks,
Shane

#1798113

Right. So if it doesn't appear in your test environment then there has to be something wrong with mine. Can you tell me what php file the [wpv-control-distance] is generated by so I can go look at the code directly? I just want to look to see if it got added somehow. I'm also about to setup a new local test and install just these plugins to have another look.

Thanks,
Jonathon

#1800029

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jonathon,

It would be a bit difficult to say which file exactly it will be in based on how our views plugin is structured.

What you can do is to test it in a fresh environment with just our views plugin and let me know if the issue is still there.

If it is then we can grab a copy for testing locally and then provide it to our development team for them to check on the issue.

Thanks,
Shane

#1810491

okay. I can't duplicate this on a clean local site. However, I also copied fresh copies of all plugins to the website with the issue and that also didn't fix it. So now I'm thinking this is being stored in the database somewhere. The Jquery script is fixing this, but it is an odd experience to see the form reload once the page is loaded. So I am still trying to sort this out without the jquery line. Do you have any suggestions on where to look or search to check on this further. I really don't want to have to build this site again from scratch.

#1810559

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jonathon,

Unfortunately no, the only suggestion I can make is to use Javascript to remove it.

This is because its not replicable on a fresh install so it is something unique to your live site only.

The javascript workaround should be ok enough to to resolve this for you.

Thanks,
Shane

#1814167

My issue is resolved now. Thank you! The jquery script fixed my issue, but I still wish I could figure out how this <br> is getting inserted into the code on this specific website.