简体   繁体   中英

Display database data in textbox dynamically

I need to check the database for saved info and if the database has info I want to paste that info in text boxes. The user should be able to edit the data when it is pasted to the text boxes.

The database can contain only one record and when the data is submitted the database will be erased.

Here is the solution I found:

function MyCtor(element, data) {
this.data = data;
this.element = element;
element.value = data;
element.addEventListener("change", this, false);
}
var x = "abc";
var y = "xyz";
var obj = new MyCtor(document.getElementById("foo"), x);
var obj = new MyCtor(document.getElementById("foo1"), y);
setInterval(function () {
obj.change(obj.element.value);
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM