How to call a function after textbox lose focus

前端 未结 3 1687
执念已碎
执念已碎 2021-02-19 20:03

I have no experience with Javascript/JQuery/AJAX so I\'m trying to understand if it\'s possible to call a function that execute a query on my DB after a textbox lose focus.

3条回答
  •  面向向阳花
    2021-02-19 20:26

    Yes, you can. First you need to wait for JavaScript event like onchange/onblur or other. Than you need to make an Ajax call to the server. It will change the data in db and can result some data, that you can put on the page. You can use jQuery to manipulate your page.

    Another way is to wait until a person presses submit button and than update data in the db.

提交回复
热议问题