This is a migrated thread and some comments may be shown as answers.

On click event with comments section

1 Answer 38 Views
Button
This is a migrated thread and some comments may be shown as answers.
Darrin
Top achievements
Rank 1
Iron
Darrin asked on 15 Jan 2016, 06:18 PM

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>

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 20 Jan 2016, 11:54 AM
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
Tags
Button
Asked by
Darrin
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or