Copied to clipboard

Flag this post as spam?

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


  • Matthias Bier 30 posts 90 karma points
    Oct 15, 2012 @ 15:24
    Matthias Bier
    0

    Wrong submit button firing

    Hello,

    I have two forms on every page:

    • a search box (.NET user control) that redirects to the search page
    • a contact form (Contour form)
    Now I have the problem that the contact form's submit button is firing when I enter a search term and hit enter. 
    I tried to wrap the search box in a asp:Panel and set the DefaultButton for the panel to the submit button of the search box.
    <asp:Panel runat="server" ID="searchBox_Panel" DefaultButton="searchBox_Button">
    <asp:TextBox runat="server" ID="searchBox_TextBox" Text="Search..." />
    <asp:Button runat="server" ID="searchBox_Button" UseSubmitBehavior="true" OnClick="searchBox_Button_Click" />
    </asp:Panel>
    This solved the problem for the search box - But now the contact form's submit does not fire anymore when I hit enter in a field of the contact form. The page only reloads, but the submit is not processed.
    Does anyone have an idea? Can I set a DefaultButton for the Contour contact form? Or do I miss something here?
    My website is running Umbraco 4.9
    Thanks for your help
    Matthias

  • Matthias Bier 30 posts 90 karma points
    Oct 15, 2012 @ 16:39
    Matthias Bier
    0

    I added a asp:Panel in the user control that renders the umbraco form (\usercontrols\umbracoContour\RenderForm.ascx) and defined the DefaultButton as b_next.

    This seems to solve my problem. Hope it does not have side effects.

     

    Matthias

Please Sign in or register to post replies

Write your reply to:

Draft