1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / HTML form implementation

HTML form implementation

6 posts, 0 answered
  1. Rainier
    Rainier avatar
    8 posts
    Registered:
    04 Dec 2008
    08 Dec 2008
    Link to this post
    Hello,

    I am trying to implement a simple email HTML form within my ASP.net coding.
    How would I go abouts doing so?

    ie:
    <form action="http://whatcounts.com/bin/listctrl" method="post">
    <input type=hidden name="slid" value="C2F278094FACCEA6CFD25BE69DD23BE0">
    <input type=hidden name="cmd" value="subscribe">

        <td>E-Mail:</td>
        <td><input type=text name=email size=25>

            <input type=submit value="Subscribe">


    Thanks in advance for you help!
  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    08 Dec 2008
    Link to this post
    Hello Rainier,

    Thanks for contacting us.

    To create an e-mail form, you need to place this code into a .ascx file and upload it into Sitefinity. We actually have a video that demonstrates this functionality on our website.

    Feel free to contact us if you have any other questions.

    All the best,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Rainier
    Rainier avatar
    8 posts
    Registered:
    04 Dec 2008
    08 Dec 2008
    Link to this post
    Hi Joe,

    Thanks for the reply, but im trying to get the form to trigger a specific action:
    I keep getting an error. what am i doing wrong?

    -----------------

        <fieldset class="sf_newsletterSubscriptionForm">

    <!--<input type=hidden name="goto" value="/thankyou.html">-->
            <ol>   
            <form action="http://whatcounts.com/bin/listctrl" method="post">
            <input type=hidden name="slid" value="C2F278094FACCEA6CFD25BE69DD23BE0">
            <input type=hidden name="cmd" value="subscribe">
                <li>
                    <asp:TextBox runat="server" Text="enter email address here" CssClass="input" ID="sf1_email" ValidationGroup="subscription"></asp:TextBox>
                </li>
                <li><asp:Button ID="subscribeEMbtn" runat="server" Text="Subscribe" CssClass="button" ValidationGroup="subscription" CausesValidation="true" /></li>
                </form>
            </ol>
           
           
           
            <small>
            <asp:RequiredFieldValidator ID="emailEmptyValidator1" runat="server"
                ValidationGroup="subscription" ControlToValidate="sf1_email" Display="Dynamic"
                EnableViewState="False" SetFocusOnError="True" CssClass="sf_emailValidation">
                <strong><asp:Literal ID="Literal1" 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="literal2" runat="server" Text="Please enter a valid email address."></asp:Literal></strong>
            </asp:RegularExpressionValidator>
            </small>
           
        </fieldset>
  4. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    09 Dec 2008
    Link to this post
    Hi Rainier,

    Thanks for contacting us.

    I have uploaded your e-mail form to Sitefinity and I do not receive any errors. What error are you receiving and what kind of action are you trying to perform? Are you trying to put the e-mail into a database? Are you trying to send an e-mail to someone else? So I can better assist you, please clarify this issue.

    I also noticed that you took some code from our newsletter module sign-up form. Are you trying to add functionality to this control or find its users? When users sign up for a newsletter, you can find their e-mails in the Administration > Users section of Sitefinity. Did you find the video helpful or are there parts that I can clarify for you?

    Greetings,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Rainier
    Rainier avatar
    8 posts
    Registered:
    04 Dec 2008
    09 Dec 2008
    Link to this post
    Hi Joe,

    Yes, i'm basically trying to set it up so that when a client enters their email into the email text box and click subscribe, the email entered will trigger the action and will automatically be entered into our email sendout database list for our newsletter sendouts, instead of manually entering them.
  6. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    09 Dec 2008
    Link to this post
    Hello Rainier,

    Thanks for the info.

    In this case, you should create a user control using a formview, a sql data source (assuming that your database is SQL Server) and bind it to your database directly. The formview has an insert button and you can rename it to subscribe if you would like. For more info on using the SQLDataSource, please review this article and this video.

    Have you considered sending our newsletter using Sitefinity instead? Our newsletter module already has a sign up form, so it is unnecessary to make your own. To use this form, please follow these instructions:

    1. Create or edit a Sitefinity page
    2. In the toolbox, click on Newsletters and drag out the subscription form
    3. Choose whether you want to register the user's e-mail only or first name, last name, and e-mail. You can also choose which newsletter you would like to use

    If you want to make customizations to this form, the file is located here:

    ~\Sitefinity\ControlTemplates\Newsletters\SubscriptionFormTemplate.ascx

    Feel free to contact us if you need further assistance.

    Regards,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered