How to map subscribe form
Hello,
I need to style subscribe form, and to remove last name, etc....
Here is my code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubscriptionFormTemplate.ascx.cs" Inherits="UserControls_SubscriptionFormTemplate" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:PlaceHolder
runat
=
"server"
ID
=
"emptyForm"
Visible
=
"false"
>
<
asp:Literal
ID
=
"Literal1"
runat
=
"server"
Text="<p
class
=
'sf_emptyForm'
>The Subscription Form has not been set yet!</
p
>"></
asp:Literal
>
</
asp:PlaceHolder
>
<
asp:PlaceHolder
ID
=
"emailhldr"
runat
=
"server"
>
<
fieldset
class
=
"sf_newsletterSubscriptionForm"
id
=
"formFieldset"
runat
=
"server"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
"Email:"
AssociatedControlID
=
"sf1_email"
></
asp:Label
>
<
asp:TextBox
runat
=
"server"
ID
=
"sf1_email"
CssClass
=
"sf_subscribeTxt"
ValidationGroup
=
"subscription"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"emailEmptyValidator1"
runat
=
"server"
ValidationGroup
=
"subscription"
ControlToValidate
=
"sf1_email"
Display
=
"Dynamic"
EnableViewState
=
"False"
SetFocusOnError
=
"True"
CssClass
=
"sf_emailValidation"
>
<
strong
><
asp:Literal
ID
=
"Literal2"
runat
=
"server"
Text
=
"Email cannot be empty!"
></
asp:Literal
></
strong
>
</
asp:RequiredFieldValidator
>
<
asp:RegularExpressionValidator
ID
=
"emailREValidator1"
runat
=
"server"
ControlToValidate
=
"sf1_email"
Display
=
"Dynamic"
EnableViewState
=
"false"
SetFocusOnError
=
"true"
ValidationExpression
=
"\s*\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\s*"
ValidationGroup
=
"subscription"
CssClass
=
"sf_emailValidation"
>
<
strong
><
asp:Literal
ID
=
"literal3"
runat
=
"server"
Text
=
"Wrong email!"
></
asp:Literal
></
strong
>
</
asp:RegularExpressionValidator
>
<
asp:Button
ID
=
"subscribeButton"
runat
=
"server"
Text
=
"Subscribe"
CssClass
=
"sf_subscribeBtn"
ValidationGroup
=
"subscription"
CausesValidation
=
"true"
/>
</
fieldset
>
</
asp:PlaceHolder
>
Hello Milos Tadic,
Can you please try using the default template, and then building on top of it.:
<%@ Control Language="C#" %>
<%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<
fieldset
id
=
"formFieldset"
runat
=
"server"
class
=
"sfnewsletterForm sfSubscribe"
>
<
sitefinity:SitefinityLabel
id
=
"widgetTitle"
runat
=
"server"
WrapperTagName
=
"h2"
HideIfNoText
=
"true"
CssClass
=
"sfnewsletterTitle"
/>
<
sitefinity:SitefinityLabel
id
=
"widgetDescription"
runat
=
"server"
WrapperTagName
=
"p"
HideIfNoText
=
"true"
CssClass
=
"sfnewsletterDescription"
/>
<
sitefinity:Message
ID
=
"messageControl"
runat
=
"server"
FadeDuration
=
"3000"
/>
<
ol
class
=
"sfnewsletterFieldsList"
>
<
li
class
=
"sfnewsletterField"
>
<
asp:Label
ID
=
"emailAddressLabel"
runat
=
"server"
Text='<%$Resources:NewslettersResources, EmailAddress %>' AssociatedControlID="emailAddress" CssClass="sfTxtLbl" />
<
asp:TextBox
ID
=
"emailAddress"
runat
=
"server"
CssClass
=
"sfTxt"
/>
<
asp:RequiredFieldValidator
ID
=
"emailValidator"
runat
=
"server"
ControlToValidate
=
"emailAddress"
ValidationGroup
=
"subscribeForm"
CssClass
=
"sfErrorWrp"
Display
=
"Dynamic"
>
<
strong
class
=
"sfError"
><
asp:Literal
runat
=
"server"
ID
=
"lEmailIsRequired"
Text='<%$Resources:NewslettersResources, EmailIsRequired %>' /></
strong
>
</
asp:RequiredFieldValidator
>
</
li
>
<
li
class
=
"sfnewsletterField"
>
<
asp:Label
ID
=
"firstNameLabel"
runat
=
"server"
Text='<%$Resources:NewslettersResources, FirstNamePublicForm %>' AssociatedControlID="firstName" CssClass="sfTxtLbl" />
<
asp:TextBox
ID
=
"firstName"
runat
=
"server"
CssClass
=
"sfTxt"
/>
</
li
>
<
li
class
=
"sfnewsletterField"
>
<
asp:Label
ID
=
"lastNameLabel"
runat
=
"server"
Text='<%$Resources:NewslettersResources, LastNamePublicForm %>' AssociatedControlID="lastName" CssClass="sfTxtLbl" />
<
asp:TextBox
ID
=
"lastName"
runat
=
"server"
CssClass
=
"sfTxt"
/>
</
li
>
</
ol
>
<
div
class
=
"sfnewsletterSubmitBtnWrp"
>
<
asp:Button
ID
=
"subscribeButton"
runat
=
"server"
Text='<%$Resources:NewslettersResources, SubscribeToList %>' ValidationGroup="subscribeForm" CssClass="sfnewsletterSubmitBtn" />
</
div
>
</
fieldset
>
<
asp:Panel
ID
=
"selectListInstructionPanel"
runat
=
"server"
>
<
asp:Literal
ID
=
"pleaseSelectList"
runat
=
"server"
Text='<%$Resources:NewslettersResources, ClickEditAndSelectList %>' />
</
asp:Panel
>