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

Forums / Developing with Sitefinity / Claims login button event, before the callback

Claims login button event, before the callback

3 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 May 2013
    Link to this post
    What's the best way to be able to modify the username in the claims login widget BEFORE the username is sent?

    We upgraded to claims and the problem is before they used to log in with "steve" and the forms backend would append the "@email.com" to validate...now I do it in javascript on blur of the inputs.

    However some people use the browser default save password feature so the "blur" never triggers, and calling click on the button itself doesn't seem to maybe happen early enough because the authentication callback is sending the PREappended username.

    Steve
  2. Martin Gebov
    Martin Gebov  avatar
    15 posts
    Registered:
    03 Nov 2016
    10 May 2013
    Link to this post
    Hi Steve,

    You can try subscribing for the form onsubmit event, which is fired before the form is sent to the server. From there you can manipulate the username.

    Here is the markup I used:

    <head runat="server">
        <title></title>
        <script>
            function onFormSubmit() {
                alert('Hi');
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server" onsubmit="onFormSubmit()">
        <div>
            <asp:Button runat="server" Text="Submit" ID="buttonSubmit" />
        </div>
        </form>
    </body>
    </html>
    Greetings,
    Martin Gebov
    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
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    10 May 2013 in reply to Martin Gebov
    Link to this post
    Actually also seems to work if you map the template and change OnClientClick="return false;" to OnClientClick="fixInput(); return false;"

    :)

    Thanks!
3 posts, 0 answered