Registration form with pre-selected fields

7 years 1 month ago #292451 by stuntlist
Hi,

We have a CB registration form that has some checkboxes at the top of it. What I would like to be able to do is have a link to the registration form that has a particular checkbox already ticked when you get to the form. See: www.staging.stuntlist.com/membership/registration. I would like to make 4 different links that go to the form with each of those top four checkboxes ticked (one checkbox for each link). So, if I am a Stunt Coordinator and click a Register link, it will take me to the registration form and the "I am a Stunt Coordinator" tick box is checked. If I am a Puller there would be a Register link that goes to the form and the "I am a Stunt Puller" checkbox is ticked, etc.

I have figured out how to change the registration form fields to show or hide depending on which checkbox is ticked. But I haven't been able to find how to get to the registration form with a particular field pre-selected.

Could you please detail how to do this or point me to some documentation that describes how to do this.

Thank you.

Please Log in to join the conversation.

7 years 1 month ago #292468 by krileon
Replied by krileon on topic Registration form with pre-selected fields
We've no functionality for that. CBs registration form does not grab values from GET and only grabs values from POST if the registration save process errors. You'd probably have to act on onBeforeRegisterFormDisplay trigger and modify var1 (the user object) by reference to accomplish that.


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 to join the conversation.

7 years 1 month ago #292488 by stuntlist
Replied by stuntlist on topic Registration form with pre-selected fields
Hi Kyle,

I have 4 register buttons, one for each case:
  1. When the user clicks button 1 display the registration form with cb_apprentice field set to 1.
  2. When the user clicks button 2 display the registration form with cb_coordinator field set to 1.
  3. When the user clicks button 3 display the registration form with cb_puller field set to 1.
  4. When the user clicks button 4 display the registration form with cb_rigger field set to 1.

Could you please provide more details on how I would use the trigger onBeforeRegisterFormDisplay to do this. How do I have each button do a particular Auto Action? Is the Type Field? How would I setup the Condition? If the type is field then in the Action tab I can set say cb_apprentice = 1.

I am not sure why/what I would need to modify in var1 (the user object), it is a registration field that I want to have ticked.

I am basically lost as to how to set up the trigger/auto actions.

Thank you.

Please Log in to join the conversation.

7 years 1 month ago #292499 by krileon
Replied by krileon on topic Registration form with pre-selected fields
Below might work.

Global
Triggers: onBeforeRegisterFormDisplay
Type: Code
User: Automatic
Access: Everybody
Conditions
1: [get_type] Equal To 1
Action
Method: PHP
Code:
$vars['var1']->set( 'cb_apprentice', 1 );
Return: Silent
Parameters
References: Variable 1

The above should set cb_apprentice to 1 (checked) if the URL contains &type=1. You can use whatever you like for the GET variable as &type is just an example.


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 to join the conversation.

7 years 1 month ago #292512 by stuntlist
Replied by stuntlist on topic Registration form with pre-selected fields
Hi Kyle,

Thank you for your help. Unfortunately, this didn't work.

Here is the starting page: www.staging.stuntlist.com/register. I setup the first Join Now button to be type 1.
I setup an Auto Action like you described above.
When you get to the registration form, the field "I have under 6 stunt credits", which is cb_apprentice is still unticked.

I turned on debuggin, but it didn't show anything. I also did a var_dump and it shows NULL.

I have attached the AutoAction screens

It looks like $vars->set( 'cb_apprentice', 1 ); is not working to set the checkbox.

Any other ideas to try?

Thanks again for the help.
Attachments:

Please Log in to join the conversation.

7 years 4 weeks ago #292535 by krileon
Replied by krileon on topic Registration form with pre-selected fields
The below confirmed works. It's acting on the default value initialization since that is what is returning the field back to null after your action marked it checked.

Global
Triggers: onAfterinitFieldToDefault
Type: Code
User: Automatic
Access: Everybody
Conditions
1: [get_type] Equal To 1
Action
Method: PHP
Code:
$vars['var2']->set( 'cb_apprentice', 1 );
Return: Silent
Parameters
References: Variable 2

Note this trigger uses var2 instead of var1 and its reference variable needs to be adjusted as well.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.176 seconds

Facebook Twitter LinkedIn