attachEvent on an input field

Hello,
Is there a common way to attach an event like “onChange” on an input field ?
I’d like to trigger a window pop-up after editing this input field and hitting “tab” or “Enter” buttons, or simply leaving the field
Thanks :stuck_out_tongue:
Regards.

I tried this :

var psi = myForm.getInput('login'); if (window.addEventListener) { psi.addEventListener("onChange",myFunction,false); } else { psi.attachEvent("onChange",myFunction); };

But it doesn’t work :frowning:

Hi

dhtmlx Events and native browser events are different. in your code I see native window event. please attach your demo, I will check depending on version of your form how to catch onchange.

Hi Andrei and thank you for your answer.
It looks like I could find how to handle this, but I’m not really sure…

[i]Here is an example of my code : [/i] myform.getInput('myInput').onchange = doAction; function doAction() { // get the value input myInputVal = myForm.getInput("myInput").value; // Send the request dhtmlxAjax.get("myFile.php?param1="+ myInputVal ); }

Could you have a look on it please ?

Regards

Hi

Demo means completed demo including all corresponding js/css files, not several codelines.