Hi all,
I'm devloping an AsP.NET 2.0 WebApp.
I added a JavaScript file (
js) to one of my pages (ClientRegister...)
I'm debugging in IE7 and there everything works great.
But when i try it in FF I get weird errors.
To give you a ruff draw of the page:
it's an overviewpage with sevral custom made popup windows (like for search or status-view). Now I want that when you hit the "enter" key
that it doesn't do anything except when you're in a textbox of one of the search-poppup, it should be replacing a mouse click on the button 'search'.
In IE7 this model works great, but when I load the page in FF I get following error:
Quote:
|
quote: missing ( before formal parameters
|
Quote:
|
[Break on this error] function document.onkeydown()\n
|
for make the enter key do the same as the button and evrywhere else do nothing I use following javascript-function:
Code:
function document.onkeydown()
{
if(event.keyCode ==13)
{
var searchCompanyEl = document.getElementById(CPH_Results + '_tCompanyName');
var searchUnitByIdEl = document.getElementById(CPH_Results + '_tUnitId');
var searchUnitByNameEl = document.getElementById(CPH_Results + '_tUnitName');
switch(event.srcElement)
{
case searchCompanyEl :
document.getElementById(CPH_Results + '_lbCompanySearch').click();
break
case searchUnitByIdEl :
document.getElementById(CPH_Results + '_lbSearch').click();
break
case searchUnitByNameEl :
document.getElementById(CPH_Results + '_lbSearch').click();
break
}
event.returnValue = false;
event.cancel = true;
}
}
From the moment this error get prompted ALL my javascript gives an undefinied error when called.
Can someone help? I've been looking for like half a day and still nothing. Thx all.
Grtz