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

Paypal Form

7 posts, 0 answered
  1. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    24 Mar 2010
    Link to this post
    I am trying to add a paypal form to an existing sitefinity page. What is the best way to have this work.

    <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="email@scpolicycouncil.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="supporttype" />
    <input name="a3" type="text" value="100.00" size="9" />
    <input type="submit" value="Monthly"  />
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="M">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="sra" value="1">
    <input type="hidden" name="item_name" value="The Nerve - Monthly Donation">
    </form>
  2. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    25 Mar 2010
    Link to this post
    This is a real problem we are using paypal and I have to have the ability to allow the user to add an amount to a field and submit it to Paypal. Is there no way to work around this? I have tried and iFrame and it does not work. PLEASE HELP!!

    Thanks in advance for your help..
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Mar 2010
    Link to this post
    Hello Steven Lancaster,

    You could create a  user control and put the form inside it.  Then drop the control on a page.

    sample code - as you can see if you use a user control you should have two forms as shown in the code.


    <form name="test" method="post">
    </form>
     
    <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr"  method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="email@soememailhere.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="supporttype" />
    <input name="a3" type="text" value="100.00" size="9" />
    <input type="submit" value="Monthly"  />
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="M">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="sra" value="1">
    <input type="hidden" name="item_name" value="The Nerve - Monthly Donation">
    </form>

    You could add the form inside your master page , outside of the default runat server form as shown below

    <%@ Master Language="C#" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <script runat="server">
     
    </script>
     
    <head runat="server">
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />    
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <div id="wrapper">
            <div id="Header">
                <h1>My Organization</h1>
                <div id="TopNavigation">
                    <asp:contentplaceholder id="TopMenu" runat="server"></asp:contentplaceholder>           
                </div>
            </div>
            <div id="Main"><asp:contentplaceholder id="Content" runat="server"></asp:contentplaceholder></div>
            <div id="SideBar"><asp:contentplaceholder id="SideBarContent" runat="server"></asp:contentplaceholder></div>   
            <div id="Footer">2006-2007 © MyOrganization. All rights reserved </div>
           </div>
               
       </form>
        
    <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr"  method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="email@soememailhere.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="supporttype" />
    <input name="a3" type="text" value="100.00" size="9" />
    <input type="submit" value="Monthly"  />
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="M">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="sra" value="1">
    <input type="hidden" name="item_name" value="The Nerve - Monthly Donation">
    </form>
     
    </body>
    </html>




     Below is a sample code that will show you the data that is has been posted. You can add the server code on Page_Load of the user control

    System.Text.StringBuilder displayValues =
         new System.Text.StringBuilder();
          System.Collections.Specialized.NameValueCollection
              postedValues = Request.Form;
          String nextKey;
          for (int i = 0; i < postedValues.AllKeys.Length; i++)
          {
              nextKey = postedValues.AllKeys[i];
              if (nextKey.Substring(0, 2) != "__")
              {
                  displayValues.Append("<br>");
                  displayValues.Append(nextKey);
                  displayValues.Append(" = ");
                  displayValues.Append(postedValues[i]);
              }
          }
          Label Label1 = new Label();
          Label1.Text = displayValues.ToString();
          Controls.Add(Label1);


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  4. Mark
    Mark avatar
    86 posts
    Registered:
    08 Feb 2010
    20 Apr 2010
    Link to this post
    Surely by placing the form below the other form, your button will appear at the bottom of the page below the footer?

    what solution is there for having the button in the main content area without trying to position it with clever CSS?
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Apr 2010
    Link to this post
    Hi Dave,

    You can assign the form a class attribute. Then use styling rules to position this class however you wish.

    All the best,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Ted
    Ted avatar
    28 posts
    Registered:
    08 Jan 2008
    12 Aug 2011
    Link to this post
    I am wanting to do a similar thing for a client but they are using mailchimp and want to create their own forms and add them to the pages.  is there anyway I can setup a user control so they can add the form to it themselves?  so they drag the usercontrol on the page in sitefinity but then can copy and paste the embeded form code from mailchimp to the usercontrol and have it show on the page correctly?

    just looking for ideas
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    15 Aug 2011
    Link to this post
    Hi Ted,

    You can use StringBuilder  to add your logic.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered