Click to See Complete Forum and Search --> : How do you emulate keypress using javascript


icw
August 22nd, 2003, 11:05 AM
How do you emulate keypress using javascript? for example a javascript program that has the functionality as pressing 'ctrl+f' on your key board to open the 'Find (on This Page)' in internet explorer.

neagle
August 22nd, 2003, 06:45 PM
Well, I am afraid that this kind of functionality is not supported by Javascript methods. I think that one has to use some other technique like which is used to add a site in favourites folder. I have used this technique much before.
I have worked a bit on adding a page state to favourites like this.


<HTML>
<HEAD>
<META NAME="save" CONTENT="favorite">
<STYLE>
.saveFavorite {behavior:url(#default#savefavorite);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
oPersistInput.setAttribute("sPersistValue",oPersistInput.value);
}
function fnLoadInput(){
oPersistInput.value=oPersistInput.getAttribute("sPersistValue");
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT class=saveFavorite onsave="fnSaveInput()" onload="fnLoadInput()" type=text id=oPersistInput>
</BODY>
</HTML>




I hope this idea might help you in your problem.

Happy Coding,
neagle.

icw
August 26th, 2003, 04:59 PM
thank you neagle