Page 1 of 1
Custom Self Registration Form
Posted: Wed Jun 13, 2007 10:48 pm
by jimmyb
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.
Re: Custom Self Registration Form
Posted: Thu Jun 14, 2007 1:29 am
by calguy1000
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.
Re: Custom Self Registration Form
Posted: Thu Jun 14, 2007 10:40 am
by jimmyb
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?
Re: Custom Self Registration Form
Posted: Thu Jun 14, 2007 12:45 pm
by calguy1000
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.
Re: Custom Self Registration Form
Posted: Thu Jun 14, 2007 1:17 pm
by jimmyb
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.
Re: Custom Self Registration Form
Posted: Tue Jun 14, 2011 11:58 pm
by pixelita
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.
@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!)
Re: Custom Self Registration Form
Posted: Wed Jun 15, 2011 5:19 am
by chrismarie
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:
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}
It's pretty lame, but it works for me

Re: Custom Self Registration Form
Posted: Mon Jun 20, 2011 5:51 am
by pixelita
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.
Re: Custom Self Registration Form
Posted: Mon Jun 20, 2011 6:50 am
by pixelita
Nope. Doesn't work. I'm using it in the Registration 1 template like this:
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 -->
What am I doing wrong?
Re: Custom Self Registration Form
Posted: Mon Jun 20, 2011 7:05 am
by chrismarie
Are you getting an error message of any sort? What output do you get from
Re: Custom Self Registration Form
Posted: Mon Jun 20, 2011 7:09 am
by chrismarie
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
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
Posted: Mon Jun 20, 2011 11:51 am
by chrismarie
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;*/
}