FancyPrairie
Programmer
When the user enters a field (input box or textarea) I want the text to automatically be selected. I know that it can be done via the onfocus event of the control (i.e. document.all(window.event.srcElement.uniqueid).select). However, I don't want to have to add onfocus=... to the definition of every input box. Is there a document event or something that gets fired each time a element receives focus?
I've tried using the onfocus event of the document (document_onfocus), but that never seems to fire off. I've also tried the onfocusin event of the document. Although that fires each time a field receives focus, the fields are not selected. For example, the following code does not work in the onfocusin event.
I've tried using the onfocus event of the document (document_onfocus), but that never seems to fire off. I've also tried the onfocusin event of the document. Although that fires each time a field receives focus, the fields are not selected. For example, the following code does not work in the onfocusin event.
Code:
sub document_onfocusin()
document.all(window.event.srcElement.uniqueid).select
end sub