Skip to Content Skip to Menu

[SOLVED] Substitution in registration form

10 years 9 months ago - 10 years 9 months ago #239695 by Ajablonski
[SOLVED] Substitution in registration form was created by Ajablonski
I am trying to create a Terms and Conditions scroll box on the registration form. It has to be a scroll box because we want to force the user to scroll to the bottom before seeing the checkbox to accept. I created the Terms and conditions box as a field delimiter. Then a created a checkbox field for the accept button, cb_termsandconditionsbox. I tried to place [cb_termsandconditionsbox] at the bottom of the delimiter text. Only the shortcode shows. I read in a different forum post that you have to be logged in to have the shortcode show as a field. Is there anyway I can get this to work while keeping with the same method I've been trying? I understand there is a way to do this with jQuery, but I'm not as familiar/comfortable with it to want to go that route yet.
Last edit: 10 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239716 by krileon
Replied by krileon on topic Substitution in registration form
Substitutions don't do anything if there is no user to grab the information from. To workaround this you can force a user id to the substitution so it always uses the information of an existing user. Example of this as follows.

[cb:userfield field="cb_termsandconditionsbox" user="42" /]

Replace 42 with your users actual user id. Please see the below tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

10 years 9 months ago #239853 by Ajablonski
Replied by Ajablonski on topic Substitution in registration form
Thank you for your response. I'm not sure if this is exactly what I'm looking for though. Since this is within the registration form, the user doesn't technically have an ID yet. I still tested the code and placed a current ID in there but when I saved and looked at it, nothing was there. By looking at the link you provided me, it looks like it would display information saved from that field, not actually show the field. Essentially what I am doing is creating a delimiter field for the registration form where I post all of the terms and conditions inside. At the bottom I want to display a checkbox that the user is required to check. I would like this displayed in the database. I was able to recreate an input field and make it required using HTML, but it didn't save anything in the database. I wasn't able to get the Auto Actions to save anything to the database for this checkbox either... This is a private staging site so if you would like to see what I was doing please let me know and I can PM it. Thanks!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239855 by krileon
Replied by krileon on topic Substitution in registration form
The best way to accomplish that is to use a multi-checkbox with only 1 value. For the value you'd use a language string like _UE_MYTERMS. Next you'd define the language string within CBs language files as follows with any HTML you need.

define( '_UE_MYTERMS', 'My terms and conditions here' );

This won't be necessary with CB 2.0 though as it has a new Terms and Conditions fieldtype.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

10 years 9 months ago #239861 by Ajablonski
Replied by Ajablonski on topic Substitution in registration form
I will give that a go. Do you know when 2.0 will be out and if it is an easy update from 1.9.1 to 2.0?

Please Log in or Create an account to join the conversation.

10 years 9 months ago #239864 by Ajablonski
Replied by Ajablonski on topic Substitution in registration form
I tried your method and all worked except the checkbox is at the top of the field. I needed it at the bottom so the user was forced to scroll to the very bottom to check it. I'm not thinking this method is going to work... Is there no way to display a checkbox field inside of another field?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum