On click event with comments section

2 posts, 0 answers
  1. Darrin
    Darrin avatar
    3 posts
    Member since:
    Nov 2015

    Posted 15 Jan Link to this post

    I'm using a rad button to ask the user if they want to cancel a request. See code below  

    Is there a way to incorporate a comments section that will allow users to say why they want to cancel their request ? 

     

    Any help would be appreciated

     

     <script type="text/javascript">
        function OnClientClicked(button, args) {
            if (window.confirm("Are You Sure You Want to Cancel This Request?")) {
                button.set_autoPostBack(true);
            }
            else {
                button.set_autoPostBack(false);
            }
        }
        </script>

     

    <telerik:RadButton ID="b2" runat="server" ButtonType="LinkButton" 
                                Font-Names="Verdana" Font-Size="Small" Height="30" Skin="Windows7" 
                                Text="Cancel Request" OnClick="b2_Click" OnClientClicked="OnClientClicked">
                                <Icon PrimaryIconCssClass="rbRemove" PrimaryIconLeft="7" PrimaryIconTop="7" />
                            </telerik:RadButton>

  2. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 20 Jan Link to this post

    Hi Darrin,

    The easiest way to achieve the desired scenario is to use the standard window prompt() dialog. For example:
    function OnClientClicked(button, args) {
        if (window.prompt("Are You Sure You Want to Cancel This Request? Why?")) {
            args.set_cancel(true);
        }
    }

    In case you need to customize the prompt dialog itself, I woul advise that you review the following help article describing how this can be achieved with our RadPrompt and/or RadConfirm dialog utilizing their template functionality|:
    How to Change the Dialog Templates


    Regards,
    Vessy
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top