Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > custom submit button on registration form View modes: 
User avatar
Member
Member
marco-p - 8/30/2011 5:54:49 AM
   
custom submit button on registration form
Hi,
for the customization of the registration form, I add a new submit button,but it is not displayed on the page. is still dysplayed the default button.
there is a way to add a submit button or to customize the default button?
Thanks in advance.

User avatar
Member
Member
kentico_michal - 8/30/2011 6:40:09 AM
   
RE:custom submit button on registration form
Hello,

Could you please let me know whether you want to customize the standard Registration form web part ( ~\CMSWebParts\Membership\Registration\RegistrationForm.ascx )?

If so, there is already a default button (with the ID="btnOK")

<asp:Panel ID="pnlForm" runat="server" DefaultButton="btnOK">

<cms:CMSButton ID="btnOk" runat="server" OnClick="btnOK_Click" CssClass="ContentButton" EnableViewState="false" />


You can change this setting and use an ID of your custom button.

Best regards,
Michal Legen

User avatar
Member
Member
marco-p - 8/30/2011 8:46:57 AM
   
RE:custom submit button on registration form
Hi,
I create an alternative form for the user table and in the layout tab I add a submit button.
then I use the "custom registration form" web part.
I didn't change any web part source code.
what is the behavior of "Insert Submit Button" in the layout tab? it doesn't display anything on my page.
the only way to customize the button is to change the web part source code?

thanks in advance.

User avatar
Member
Member
kentico_michal - 8/31/2011 3:08:10 AM
   
RE:custom submit button on registration form
Hello,

The Custom registration web part uses the DataForm control which is capable of displaying dynamic form according to your alternative form and custom layout and the web part as well uses custom submit button which is hardcoded in the layout of the web part code file (~\CMSWebParts\Membership\Registration\CustomRegistrationForm.ascx):


<asp:Panel ID="pnlRegForm" runat="server" DefaultButton="btnRegister">
<cms:DataForm ID="formUser" runat="server" IsLiveSite="true" />
<asp:PlaceHolder runat="server" ID="plcCaptcha">
<table>
<tr>
<td>
<cms:LocalizedLabel runat="server" ID="lblCaptcha" ResourceString="webparts_membership_registrationform.captcha" /></td>
<td>
<uc1:SecurityCode ID="captchaElem" runat="server" />
</td>
</tr>
</table>
</asp:PlaceHolder>
<cms:CMSButton ID="btnRegister" runat="server" CssClass="RegisterButton" />
</asp:Panel>


Please notice that there is a submit button with ID="btnRegister".

However, web part disables the submit button of the DataForm control, so this is why the submit button specified in the custom layout is not visible:


protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
// Hide default form submit button
if ((formUser != null) && (formUser.BasicForm != null))
{
formUser.BasicForm.SubmitButton.Visible = false;
}
}


So, what you can do, is to modify this web part on your own and so that it displayes only one button (standard button vs submit button defined in the alternative form)

Best regards,
Michal Legen

User avatar
Member
Member
jjason-digiknow - 6/15/2012 3:47:52 PM
   
RE:custom submit button on registration form
So there is no way to modify the button through the CMS?
Only by editing the web part, which would affect all instances of the button.

Seems like there should be a hook either on the web part or the alternative form where you can specify the button text, a CSS class and perhaps some other submit related attributes. This would only affect the specific instance then rather than every instance of the button.


User avatar
Member
Member
kentico_michal - 6/16/2012 6:41:24 AM
   
RE:custom submit button on registration form
Hi,

To change the button text, you can use the Button text property of the Custom registration form web part. CSS class for the submit button is "RegisterButton".

If you need any advanced settings, you would need to modify the web part. In that case, you can clone the web part in order to not affect every instance of the web part: Modifying the code of standard web parts.

Best regards,
Micha Legen