when i wanna set a new value in method attchHTML(vals)
vals always display the first time value.
i upload a html file
Attach to custom object
var myPop;
function showPopup(inp,vals) {
if (!myPop) {
myPop = new dhtmlXPopup();
myPop.attachHTML(vals);
}
if (myPop.isVisible()) {
myPop.hide();
} else {
var x = window.dhx4.absLeft(inp);
var y = window.dhx4.absTop(inp);
var w = inp.offsetWidth;
var h = inp.offsetHeight;
myPop.show(x,y,w,h);
}
}
function hidePopup() {
if (myPop) myPop.hide();
}
function abc(){
var val = document.getElementById("test2");
showPopup(val,document.getElementById("test2").value);
}
</script>
when i wanna popup display the value of the input of test2.value
but it cannot display
it only display the first time value,and when test2.value changed popup.attachHTML( it doesn’t dispaly newvalue )
well, your demo is almost correct, the only thing - you need to move myPop.attachHTML() to line after myPop.show(). that because if statement myPop.attachHTML() inside which is called once on init and it will work only or the 1st popup show. i.e.:
function showPopup(inp,vals) {
if (!myPop) {
myPop = new dhtmlXPopup();
}
if (myPop.isVisible()) {
myPop.hide();
} else {
var x = window.dhx4.absLeft(inp);
var y = window.dhx4.absTop(inp);
var w = inp.offsetWidth;
var h = inp.offsetHeight;
myPop.show(x,y,w,h);
myPop.attachHTML(vals);
}
}
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan