I had to develop a solution where the user could press enter or return from an input field and the correct submit button would be clicked. We could only use one form for the whole page.
This can be added to an external js file.
//In the onFocus event of the form input text element call the function
setSubmitBtn with the following parameters setSubmitBtn(form id, button id) e.g.
onfocus="setSubmitBtn('frmHitList', 'btnSave')"
//Global variable for the submit button set.
//Used by functions setSubmitBtn and keyPressed.
var submitBtnSet = null;
var btnFormId = null;
//Checks if the key pressed is the enter/return key
//If it is then click the button set by setSubmitBtn event
function keyPressed (Event) {
if (!Event)
Event = window.event;
var keyCodePressed = Event.keyCode;
if (keyCodePressed == 13) {
if (submitBtnSet != null) {
document.forms[btnFormId].elements[submitBtnSet].click();
submitBtnSet = null;
btnFormId = null;
return false;
}
}
}
//Set the submit button name which should be clicked when the user
//presses the enter or return key
function setSubmitBtn(formId, submitBtn) {
btnFormId = formId;
submitBtnSet = submitBtn;
}
//Calls the keyPressed function with every key pressed
document.onkeypress = keyPressed;
Tuesday, September 19, 2006
Saturday, March 04, 2006
Spyware and Malware
A friend had a problem with his computer running slow, crashing a lot, not booting up properly and many other abnormal things.
After a bit of looking around I discovered he had a lot of Malware and Spyware including a couple of Rootkits.
I used the Rootkitrevealer from System Internals to search for the hidden rootkits. I used Spybot from R & D to clean up a lot of the spyware and malware. I then used RegCleaner to clean up the registry.
The main guilty files I found were:
c:\WINNT\system32\drivers\fipmkchw.sys
c:\WINNT\system32\wsnxress.exe
c:\Programme\Vircanon (The folder contained a number of dodgy files - according to different anti-spyware companies - and a subfolder with logs)
They were all invisible to both Windows Explorer and MS-DOS. I removed the hard drive and added as a slave to another computer. The offending files were now visible.
I used the Autorun program from System Internals to find the registry key used at the startup.
The computer now boots up 1 minute 35 seconds faster.
After a bit of looking around I discovered he had a lot of Malware and Spyware including a couple of Rootkits.
I used the Rootkitrevealer from System Internals to search for the hidden rootkits. I used Spybot from R & D to clean up a lot of the spyware and malware. I then used RegCleaner to clean up the registry.
The main guilty files I found were:
c:\WINNT\system32\drivers\fipmkchw.sys
c:\WINNT\system32\wsnxress.exe
c:\Programme\Vircanon (The folder contained a number of dodgy files - according to different anti-spyware companies - and a subfolder with logs)
They were all invisible to both Windows Explorer and MS-DOS. I removed the hard drive and added as a slave to another computer. The offending files were now visible.
I used the Autorun program from System Internals to find the registry key used at the startup.
The computer now boots up 1 minute 35 seconds faster.
Subscribe to:
Posts (Atom)