Page 1 of 1

Typing Problem

Posted: Tue May 15, 2007 7:53 am
by calumogg.co.uk
Script URL: http://calumogg.co.uk/guestbook/gbook.php?a=sign

Hi, I have the latest version of the guestook, and I have changed the odd line here and there but the main code is still the same, but now whenever anyone is typing the the message box if they press backspace to delete a typing mistake it takes them back a page on my site (This only happens in IE not Firefox). Does anyone know what I can do to fix this?
Thanks in advance

Posted: Tue May 15, 2007 10:12 am
by Klemen
It's this code in your header:

Code: Select all

function keypress(e) {
	if(!e) var e = window.event;
	if(e.keyCode) keyCode = e.keyCode; 
	else if(e.which) keyCode = e.which;
	switch(keyCode) {
		case 8: window.location="../index.html"; return false; break;
		
		
		case 63273: case 36: window.location="index.html"; return false; break;
		case 63275: case 35: window.location="index.html"; return false; break;
		
	}
	return true;
}
When someone presses the backspace this code will redirect them to index.html.

Posted: Tue May 15, 2007 5:32 pm
by calumogg.co.uk
Cheers, got rid of that code and now it works fine! Thanks for a great guestbook.