Custom Self Registration Form
Custom Self Registration Form
Hi all
Had a really good search around for an answer to this simple issue but nothing seems to entirely fit.
My problem is with the Self Registration module's 'registration 1' template.
Whenever a new user chooses to register on my site, they are asked to complete their details on a 'Register' page that includes the Self Registration module.
I currently have over 20 individual fields that the user needs to complete including the standard 'username' 'password' etc.
The issue is with layout. The template reads the controls as an array so all 20 fields are basically listed from 1 to 20 down the page. I need to be able to seperate the fields into sections with each section having a seperate header. I can obviously do this with simple HTML within in a non module form but I can't find a way to split the fields up or even call the fields individually (as in form builder) for the self reg module.
Am I missing something or is there an easier way to do the entire thing outiside of the self reg module?
Sincere thanks in advance.
Had a really good search around for an answer to this simple issue but nothing seems to entirely fit.
My problem is with the Self Registration module's 'registration 1' template.
Whenever a new user chooses to register on my site, they are asked to complete their details on a 'Register' page that includes the Self Registration module.
I currently have over 20 individual fields that the user needs to complete including the standard 'username' 'password' etc.
The issue is with layout. The template reads the controls as an array so all 20 fields are basically listed from 1 to 20 down the page. I need to be able to seperate the fields into sections with each section having a seperate header. I can obviously do this with simple HTML within in a non module form but I can't find a way to split the fields up or even call the fields individually (as in form builder) for the self reg module.
Am I missing something or is there an easier way to do the entire thing outiside of the self reg module?
Sincere thanks in advance.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Custom Self Registration Form
unfortunately it's not entirely simple.
The controls are all in an array, and the foreach loop is what iterates through them.
In order to do some grouping of the various controls you'd have to do some smarty logic and create a new (for example) fieldset based on the prompt of the field.
Unfortunately, I don't even export the field name, I've gotta fix that in the next version.
The controls are all in an array, and the foreach loop is what iterates through them.
In order to do some grouping of the various controls you'd have to do some smarty logic and create a new (for example) fieldset based on the prompt of the field.
Unfortunately, I don't even export the field name, I've gotta fix that in the next version.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Custom Self Registration Form
Many thanks for your response Calguy, always very greateful for your help.
Do you think that it would be possible to actually make the form in FormBuilder and then process the relevant details through the self reg module by submitting the FormBuilder form to a UDT?
Do you think that it would be possible to actually make the form in FormBuilder and then process the relevant details through the self reg module by submitting the FormBuilder form to a UDT?
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Custom Self Registration Form
no it isn't possible because the formbuilder field names are processed differently. it's not hard to setup fieldsets, or things like that with SelfRegistration, it just takes a bit of time.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Custom Self Registration Form
Many thanks Calguy
I think that I might keep the actual self reg form fairly short and then redirect the new registrant to a FormBuilder page to actually complete the remaining questions.
Very grateful for your time.
I think that I might keep the actual self reg form fairly short and then redirect the new registrant to a FormBuilder page to actually complete the remaining questions.
Very grateful for your time.
Re: Custom Self Registration Form
@Calguy: is there a tutorial specifically for this, b/c I've been all over this forum looking for how to tweak the templates to achieve this. Want to make a quick $50 USD? PM me and show me how to do this. Show me once and I'll never bug you about that particular issue again. (Just a different one!)no it isn't possible because the formbuilder field names are processed differently. it's not hard to setup fieldsets, or things like that with SelfRegistration, it just takes a bit of time.
Submit your site to the We Love CMSMS showcase
Re: Custom Self Registration Form
I just hit this snag too, and instead of beating my head against the wall trying to do what normally works, I'm glad I came and found this post first. I'm sure there's a better solution around the corner, but here's how I'm tackling the issue for now:
I used the control name because I figured it'd be easier for me to reference and threw some conditional statements in the foreach loop like so:
It's pretty lame, but it works for me
I used the control name because I figured it'd be easier for me to reference and threw some conditional statements in the foreach loop like so:
Code: Select all
{foreach from=$controls item=control}
{if $control->name == 'firstname'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'lastname'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{/foreach}
Re: Custom Self Registration Form
I just don't understand why there isn't the ability to add a fieldset where you need or want one. Yeesh.
I'll try this. Thanks.
I'll try this. Thanks.
Submit your site to the We Love CMSMS showcase
Re: Custom Self Registration Form
Nope. Doesn't work. I'm using it in the Registration 1 template like this:
What am I doing wrong?
Code: Select all
<!-- Self-Reg Registration 1 template -->
{$title}
{if isset($message) && $message != ''}
{if isset($error) && $error != ''}
<p class="error">{$message}</p>
{else}
<p>{$message}</p>
{/if}
{/if}
{$startform}
<div class="feuform">
<!-- Shipping Fieldset -->
<fieldset id="shipping">
<legend><span>Shipping Details</span></legend>
{foreach from=$controls item=control}
{if $control->name == 'firstname_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'lastname_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'email_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'streetaddress_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'city_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'state_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'zip-postal-code_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'country_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'phone_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{/foreach}
</fieldset>
<!-- Billing Fieldset -->
<fieldset id="billing">
<legend><span>Billing Details</span></legend>
{foreach from=$controls item=control}
{if $control->name == 'firstname_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'lastname_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'email_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'streetaddress_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'city_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'state_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'zip-postal-code_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'country_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'phone_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{/foreach}
</fieldset>
{if isset($captcha)}
<p>{$captcha_title}: {$input_captcha}<br />
{$captcha}<br />
{/if}
{$hidden}{if isset($hidden2)}{$hidden2}{/if}{$submit}<br/>
{$msg_sendanotheremail} {$link_sendanotheremail}</p>
</div><!-- /feuform -->
{$endform}
<!-- Registration 1 template -->
Submit your site to the We Love CMSMS showcase
Re: Custom Self Registration Form
Are you getting an error message of any sort? What output do you get from
Code: Select all
{controls|print_r}
Re: Custom Self Registration Form
oooh, just noticed that you're running the foreach loop twice - that's the problem I think.
This is pretty gross, I'd find another way to handle the fieldsets, but try it out for shits and giggles
This is pretty gross, I'd find another way to handle the fieldsets, but try it out for shits and giggles
Code: Select all
<!-- Self-Reg Registration 1 template -->
{$title}
{if isset($message) && $message != ''}
{if isset($error) && $error != ''}
<p class="error">{$message}</p>
{else}
<p>{$message}</p>
{/if}
{/if}
{$startform}
<div class="feuform">
<!-- Shipping Fieldset -->
<fieldset id="shipping">
<legend><span>Shipping Details</span></legend>
{foreach from=$controls item=control}
{if $control->name == 'firstname_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'lastname_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'email_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'streetaddress_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'city_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'state_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'zip-postal-code_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'country_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'phone_shipping'}
{$control->prompt}{$control->marker}: {$control->control}
</fieldset>
{/if}
{if $control->name == 'firstname_billing'}
<!-- Billing Fieldset -->
<fieldset id="billing">
<legend><span>Billing Details</span></legend>
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'lastname_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'email_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'streetaddress_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'city_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'state_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'zip-postal-code_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'country_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{if $control->name == 'phone_billing'}
{$control->prompt}{$control->marker}: {$control->control}
{/if}
{/foreach}
</fieldset>
{if isset($captcha)}
<p>{$captcha_title}: {$input_captcha}<br />
{$captcha}<br />
{/if}
{$hidden}{if isset($hidden2)}{$hidden2}{/if}{$submit}<br/>
{$msg_sendanotheremail} {$link_sendanotheremail}</p>
</div><!-- /feuform -->
{$endform}
<!-- Registration 1 template -->
Re: Custom Self Registration Form
It's working? Your legend problem is being cause by this
Code: Select all
legend {
display: none;
/* color:#098bbf;
background:#fff;
font-style:italic;
font-size:1.2em;
margin-bottom:0.5em;
padding:0.2em;
width:auto;
border: none;*/
}