Skip Navigation

[Resolved] check box: label with link

This support ticket is created 6 years, 6 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
- - 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)

This topic contains 23 replies, has 2 voices.

Last updated by Beda 6 years ago.

Assisted by: Beda.

Author
Posts
#875886

I have a checkbox for the privacy policy

how can I add a link to the text "label" of the box?
I would also like to remove the asterisk at the end of the text
you see: hidden link

[cred_generic_field field='privacy-policy' type='checkbox' class='' urlparam='']
{
"required":1,
"validate_format":0,
"checked":0,
"default":"1",
"label":"By signing up you accept the terms and LINK ->Privacy Policy  <- LINK "
}
[/cred_generic_field]

thank you

#876782

The * is hardcoded, we have a request filed to customize it.
For now, you need to make the generic field not required and validate it with some code (for example cred_form_validate) if you want to remove that asterisk.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Within that hook, you could check if the $_POST field is not empty and proceed, or abort if empty and throw an error.

To have the label link anywhere, you can simply add a HREF link to the field's label value:

<a href='<em><u>hidden link</u></em>;

Pay attention to the apostrophes, single within double apostrophes is OK, double within double or single within single is NOT OK. It will make the field disappear from the form.

This is due to a WordPress restriction about which you can read more here:
https://make.wordpress.org/core/2015/07/23/changes-to-the-shortcode-api/

#878657

last thing, I added this code to align the box and the text (label)
but it does not work. what am I doing wrong ?

.wpt-form-label wpt-form-checkbox-label  {
  display:inline;
  }
#878830

I suggest consulting CSS and HTML tutorials and Documentations.
hidden link

At Toolset Support, we can help to create things with Toolset, but Toolset does not offer a CSS or HTML code generator - it's a required knowledge set to use Toolset.

However, Toolset Forms Generic Checkbox is already inline by default.
At least, it is when I set one up locally.

I suggest as well to test this without any other custom code or plugin, maybe something else is changing the styles?

In my case, Bootstrap takes care of the inline display.

#887562

it is not my intention to ask for additional work,
I do not understand how to handle the inline command within the checkbox label of a CRED module.

[cred_generic_field field='privacy-policy' type='checkbox' class='checkbox-inline' urlparam='']

I used the class: checkbox-inline
as explained on the site: hidden link

but it does not work, why? I do not want to waste hours for this thing!

thank you

#887860

1. When either your theme loads Bootstrap or you load Bootstrap with Toolset, then that Checkbox Label is already inline, as I elaborated earlier.

2. If you do not use Bootstrap, the checkbox and label are not on the same line.

3. If you prefer to not use Bootstrap, you can not follow W3 School's advice, which as you can see in the example, uses Bootstrap Markup

<label class="checkbox-inline"><input type="checkbox" value="">Option 1</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 2</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 3</label>

4. Hence, if you are not using Bootstrap, you can simply address the parent div class with a "display: inline-flex;" or similar.

#888833

I used toolset layout to create the page, so it should be bootstrapped. I do not understand why I do not see the line

#889019

What do you mean by "see that line"?

I assume then your HTML is broken and does not even output something, and we would be back at the first issue.

1. Please head to Toolset > Settings > General and make sure bootstrap is loaded
2. Make sure to have followed my instructions on how to insert the label link

If this does not work, please share temporary access (WP-Admin and FTP) to your site
in order to be of better help
Your next answer will be private which means only you and I have access to it.

Please as well share the links of where the issue can be seen and edited.

As well make sure this is not due to another Plugin or Theme, by deactivating them and check the issue again.

#891753

Right now on your site, it seems that another Style is loaded instead of only the Bootstrap Framework and it overwrites Bootstrap Rules.

I did not deactivate any theme or plugin but that is what we would need to do in order to see why this is happening.

Meanwhile, you can address it with CSS:

div.js-wpt-field-items.js-wpt-repetitive.wpt-repetitive {
  display: -webkit-inline-box;
}

But that is a not a cool solution as it addresses generic classes that Toolset adds to the fields DIV.

It would be better to temporarily deactivate the Theme and Plugins, to see which one causes the overwriting.
Then it could be analysed if it can be solved in either software.

And to proceed, you would need to update Toolset first.

#891788

there's a problem ... I have the header and the menus with problems. I see which plugin is the cause of the problems and I tell you

#891835

Please let me know anytime what is the plugin interfering.

Please as well share a download link so I can make tests with it, and I will need the steps towards the issue.

#891856

I have disabled the Ocean Extra plugin that is part of the OceanWP theme and the Header and the menu are perfect!

if you want to do some tests. I leave the plugin disabled

#891951

Please update your software (Toolset).

Then, if the issue persists, disable the Theme.
If the issue is still there, disable all plugins but Toolset.

If then the issue is still present, please send me a copy of this site
hidden link

I suggest doing the tests on a staging site, or after a good backup.

#892304

Ok, please let me know if you can spot the Plugin or Theme.

Did you update Toolset Forms (Former Toolset CRED)?

#894230

I updated Cred, unfortunately I deleted the label from the fields.