Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phillip Ng 148 posts 250 karma points
    May 23, 2011 @ 22:30
    Phillip Ng
    0

    Want to post form to external url

    Hello

    I created a custom contact form, that is supposed to post to an external URL, specifically SalesForce.

    <form id="ContactPageForm" runat="server" title="Salesforce" method="Post" action="https://www"...>

    The HTML output however is

    <form method="POST" action="/contact.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">

    There was a forum post about this already, but the user's contact form was built from Contour. Looking at some other related topics isn't answering my question. Am I being really dense or is there an easy way I can change the default behavior of the form so that it can post to the correct URL? Thanks in advance!

     

    Phil

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    May 23, 2011 @ 23:13
    Stefan Kip
    0

    You can only include a new form on the page outside the default ASP.NET form: http://www.frederikvig.com/2009/06/using-multiple-forms-on-an-asp-net-web-forms-page/

  • Pasang Tamang 258 posts 458 karma points
    May 24, 2011 @ 05:37
    Pasang Tamang
    0

    Hi Phillip,

    I can see there is runat="server" in your first form tag. Using the runat="server" in form, the form is always submitted to the same page which you're viewing and if you set an action attribute, it is ignored and always set an action to post method. So if you want to post form to external url then you should remove runat="server".

    Thanks

    Pnima

  • Phillip Ng 148 posts 250 karma points
    May 24, 2011 @ 18:16
    Phillip Ng
    0

    Thanks for the responses! @Pasang: Removing the runat="server" caused the page to break for some reason. I ended up adding another form element with the runat="server" and removing that from the Salesforce form element. I really appreciate the help!

Please Sign in or register to post replies

Write your reply to:

Draft