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

Add Attribute of RadTextBox for OnValueChanging

2 Answers 163 Views
Input
This is a migrated thread and some comments may be shown as answers.
Akhil Raj
Top achievements
Rank 1
Akhil Raj asked on 31 May 2010, 09:00 AM
hi,
  I am using radtextbox to enter text. I need to show confirm box when user changed the value in the textbox. So i added onvaluechanging method like as fowllows:
            function ConfirmUpdate(sender, eventArgs) {  
                var oldvalue = eventArgs.get_oldValue()  
                if (confirm('Are you want to Continue? ') != true)  
                    eventArgs.set_newValue(oldvalue)   
            } 

This work correctly. But i need to add this function from the code behind because of 2 reasons
1. I use this textbox for insert and update functions. When update only need to ask the confirm.
               - i can handle this in script itself by comparing oldvalue and newvale
2. I need to pass myown message t the confrm box.
               - For this i want to add this event from the code behind.

How can i add this function to the textbox attribute?
How can i pass message without affect the eventArgs values?

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 03 Jun 2010, 01:42 PM
Hi Akhil,

On the server side an event will be fired only after the value is already changed, so the confirmation procedure will not be as simple as it is on the client side. Could you please elaborate a little more on the matter with client-side handling? What is it that you cannot get to work concerning the confirmation message?


Greetings,
Tsvetina
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Akhil Raj
Top achievements
Rank 1
answered on 04 Jun 2010, 05:48 AM
hi admin,
  I solved the issue by calling client side function from code behiond. I just save the old value in onfocus event and reset values in onchange event ..thanks
Tags
Input
Asked by
Akhil Raj
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Akhil Raj
Top achievements
Rank 1
Share this question
or