Using AJAX to update an input textbox from an input textbox

2 posts, 0 answers
  1. Kurtis
    Kurtis avatar
    3 posts
    Member since:
    Apr 2016

    Posted 30 Dec 2016 Link to this post

    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?

     

     

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1642 posts

    Posted 04 Jan Link to this post

    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.
Back to Top