Sauter la navigation

[Résolu] Display showing as div instead of span

This support ticket is created Il y a 4 années et 10 mois. 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Beda Il y a 4 années et 10 mois.

Assisté par: Beda.

Auteur
Publications
#1521471
output.png

I am trying to: Display a single checkbox on a user registration field

Link to a page where the issue can be seen: lien caché

Some one recommended I report this: Display Mode is not correct. Should be "span" and not "div",

<div class="form-group">
<label>Subscribe for announcements</label>
<div class="js-wpt-field-items js-wpt-repetitive wpt-repetitive" data-initial-conditional="" data-item_name="checkbox-Keep me up to date"><input type="checkbox" id="cred_user_form_56_1-checkbox-3-1582303603" name="Keep me up to date" data-wpt-type="checkbox" data-wpt-id="cred_user_form_56_1_cred_user_form_56_1-checkbox-3-1582303603" data-wpt-name="Keep me up to date" value="1" class=" wpt-form-checkbox form-checkbox checkbox" preset_value="" cred_generic="1" placeholder="" preview="" urlparam="">&nbsp;
<label class="wpt-form-label wpt-form-checkbox-label" for="cred_user_form_56_1-checkbox-3-1582303603">Keep me up to date</label>
<input type="hidden" name="_wptoolset_checkbox[cred_user_form_56_1_Keep me up to date]" value="1">
</div>
</div>

My issue is the field slug is showing on the front end. The single checkbox displays like checkboxes with a main label and a checkbox label. I'm not clear on the selections. I was recommended to use underscores in the field slug, which ended up being a duplicate of the label.(see img of output)
https://toolset.com/forums/topic/execute-post-url-for-a-newsletter-list-via-checkbox-on-user-registration-form/#post-1520283

#1522469

I'm not sure what you mean.

On the page you share I see a Labeled checkbox "Keep me up to date", not like on the screenshot.
That's not a DIV, it's an INPUT tag.
That can't be a span, as it needs to be an input.

Inputs have Labels, that's where you see the text
All of this, is in a DIV.
But you can easily remove that DIV by removing it from the HTML in the Form Editor:
lien caché

For this you'll need to use expert mode, and remove the DIV around the part below of the field:

<div class="form-group">

There you can also remove the Label if you want.

Does this help?

#1522727

Ah ok, that makes sense. The the name selector in a hook would change?

#1526495

What do you mean with "The the name selector in a hook would change?"

There is no "hook" for this if you refer to WordPress Actions and Filters.