Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Input > EnableSingleInputRendering and FormSubmit

Not answered EnableSingleInputRendering and FormSubmit

Feed from this thread
  • Max avatar

    Posted on Feb 1, 2012 (permalink)

    Hi,
     When EnableSingleInputRendering is "true" for a PasswordField (RadTextBox), all submit behaviors of form and buttons are not working.
    <form id="form1" runat="server" defaultbutton="LogOn" acceptbutton="LogOn" >
    <telerik:RadButton ID="LogOn" runat="server" Text="Login" OnClick="LogOn_Click" UseSubmitBehavior="true">
                                            </telerik:RadButton>

    Neither ENTER triggers postback nor can I invoke it programmatically from JS.

    Clicking on the button, however, works.

    Thanks for help,
     Max

    Reply

  • Vasil Vasil admin's avatar

    Posted on Feb 1, 2012 (permalink)

    Hi Max,

    We are aware that the default button is not executed when you click Enter in the input with EnableSingleInputRendering=True , and we are currently working on this issue.
    However making PostBack using JavaScript should work as expected. Could you share an example code with us for further debugging here?

    Kind regards,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • Max avatar

    Posted on Feb 2, 2012 (permalink)

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Auth.aspx.cs" Inherits="Org.Auth" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body onload="CheckRadWindow();" onkeydown="Keydown(event);">
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator" runat="server" Skin="WebBlue" DecoratedControls="All" />
                                <telerik:RadTextBox ID="Password" runat="server" TextMode="Password"  EmptyMessage="password" EmptyMessageStyle-BackColor="Yellow"  EnableSingleInputRendering="true">
                            </telerik:RadTextBox>
                                            <telerik:RadButton ID="LogOn" runat="server" Text="Enter" OnClick="LogOn_Click" UseSubmitBehavior="true">
                                            </telerik:RadButton>
    </form>
    </body>
    </html>
    // Auth.js
    function
    Keydown(event) { // Triggers Ok
        var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
        // process only the Enter key
        if (keyCode == 13) {
            document.form1.submit();
             
    //        var inputs = document.getElementsByTagName('input');
    //        for (var i = 0; i < inputs.length; i++) {
    //            if (inputs[i].getAttribute('type') == 'submit') {
    //                inputs[i].onclick = "LogOn_Click";
    //                inputs[i].click();
    //                document.form1.submit();
    //                return;
    //            }
    //        }
        }
    }

    Reply

  • Posted on Feb 2, 2012 (permalink)

    Hi Max

    Try this,

    <form id="form1" runat="server" defaultbutton="rbtnLogon" acceptbutton="rbtnLogon">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadTextBox ID="RadTextBox1" runat="server">
        </telerik:RadTextBox>
        <telerik:RadTextBox ID="RadTextBox2" EnableSingleInputRendering="true" runat="server"
            TextMode="Password">
        </telerik:RadTextBox>
        <telerik:RadTextBox ID="Password" runat="server" TextMode="Password"  EmptyMessage="password" EmptyMessageStyle-BackColor="Yellow"  EnableSingleInputRendering="true">
                            </telerik:RadTextBox>
                            <br />
        <telerik:RadButton ID="rbtnLogon" runat="server" Text="Login" OnClick="RadButton1_Click"
            UseSubmitBehavior="true">
        </telerik:RadButton>
        <telerik:RadButton ID="rbtnnormal" runat="server" Text="Temp Button" OnClick="RadButton1_Click">
        </telerik:RadButton>
        </form>
    protected void RadButton1_Click(object sender, EventArgs e)
          {
              RadTextBox1.Text = "Test";
          }

    Reply

  • Max avatar

    Posted on Feb 2, 2012 (permalink)

    Hi Vinoth,

    what *is* expected> pressing Enter anywhere on the page would trigger postback / function in code-behind.

    In example above Enter-key works only within RadTextBox1 and (c.o. with focus set on any of two buttons). Solution? - No.

    So the problem is in correct overriding broken submit-behavior / keydown event when any of ESIR-true TextBoxes is focused.

    Cheers,
     Max

    Reply

  • Vasil Vasil admin's avatar

    Posted on Feb 6, 2012 (permalink)

    Hello Max,

    Thank you for the provided code. I used this example and a PostBack is happening when the keydown is coming from another control. Indeed the problem is when you press enter inside the RadTextBox, since the keydown event get canceled. I as mentioned earlier, this issue is known to us and we will try to fix it.

    Greetings,
    Vasil
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Input > EnableSingleInputRendering and FormSubmit
Related resources for "EnableSingleInputRendering and FormSubmit"

ASP.NET Input Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]