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

Using AJAX to update an input textbox from an input textbox

1 Answer 1013 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kurtis
Top achievements
Rank 1
Kurtis asked on 30 Dec 2016, 03:20 PM

The problem is as followed:

I have 3 text boxes: Fee, Donation, Total.

Fee cannot be modified, and the user cannot type in this textbox

Donation starts at 0 and the user can change the value based on what they want to donate

Total needs to be updated based on what the user types in donation. It needs to be Donation+Fee

How can I use AJAX to make the Total textbox get updated on the fly based on what is entered in Donation?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 04 Jan 2017, 10:39 AM
Hello Kurtis,

In order to calculate the value for the Total TextBox you would need to use JavaScript to get the values from the other two textboxes and calculate the result. Please examine the thread below that elaborates on the functionality.


Since you would like to use the values of the TextBoxes server-side you can use a Button control that would initiate a postback. Then you can access the textboxes and their values on the server and implement the necessary custom logic.

In order to Ajax-enable the controls you can wrap the TextBoxes and the Button in a RadAjaxPanel.



Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Ajax
Asked by
Kurtis
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or