Hi All
Is there a simple way to get a referrence to the form field that currently has focus?
I want to implement copy and paste functionality and I need to know the Id of the currently focussed field. Once I have that then this works:
var fieldId = "text1";
var ptr = document.getElementById(fieldId);
var paste = ptr.createTextRange().execCommand('Paste');
I want to get the Id of the currently focussed field instead of specifying it as I have above. I know I can set a variable every time a field gets focus but I was wondering if there is a simpler/more elegant way.
Thanks
Cheers
Richard
(Johannesburg, Shouth Africa).
Is there a simple way to get a referrence to the form field that currently has focus?
I want to implement copy and paste functionality and I need to know the Id of the currently focussed field. Once I have that then this works:
var fieldId = "text1";
var ptr = document.getElementById(fieldId);
var paste = ptr.createTextRange().execCommand('Paste');
I want to get the Id of the currently focussed field instead of specifying it as I have above. I know I can set a variable every time a field gets focus but I was wondering if there is a simpler/more elegant way.
Thanks
Cheers
Richard
(Johannesburg, Shouth Africa).