haegens_nico
01-24-2005, 04:14 PM
Hello,
I am making a java servlet that generates a menu. It's to difficult to determine the exact browser in java. However, I made one in javascript. Depending on the browser(IE supports by default the onclick and onchange event), I have to make my admin menu for IE & other browsers that don't support it by default. It are a few dozen buttons that should listen to click events and a few dozen text fields(input type=text) that should listen to change events. Now here is my problem: they don't listen to the events, not change events or click events.
I have three browsers that I have tested it on: Mozilla 5.0, FireFox/1.0 & IE6. The only one that executes it normally is IE6. Here is my script:
function doAction()
{
var oSource=window.event.srcElement;
var iden=oSource.name;
window.open("/servlet/menus.DBMenuUpdate?dbname=haegens_vva&operation="+iden,"_self");
}
function capture()
{
document.captureEvents(Event.CLICK);
document.onclick=doAction;
document.onchange=saveChange;
}
function saveChange()
{
var oSource=window.event.srcElement;
var naam=oSource.name;
var waarde=oSource.value;
var newobj=document.createElement("input");
var counter=commands.childNodes.length;
newobj.type="hidden";
newobj.name="command"+counter;
newobj.value="Change "+naam+" To "+waarde;
var obj=commands.insertAdjacentElement("beforeEnd",newobj);
}
the function capture() is called here:
<body onload="capture();">
the function doAction() should be called here:
<input type="button" id="cmdVerwijderen12" name="cmdVerwijderen12" onclick="doAction()">
the function saveChange() is called here:
<input name="txtLink110" onChange="saveChange()" type="text" value="Prov_Antwerpen.htm" size="50" maxlength="50">.
Can someone please help me out?
I am making a java servlet that generates a menu. It's to difficult to determine the exact browser in java. However, I made one in javascript. Depending on the browser(IE supports by default the onclick and onchange event), I have to make my admin menu for IE & other browsers that don't support it by default. It are a few dozen buttons that should listen to click events and a few dozen text fields(input type=text) that should listen to change events. Now here is my problem: they don't listen to the events, not change events or click events.
I have three browsers that I have tested it on: Mozilla 5.0, FireFox/1.0 & IE6. The only one that executes it normally is IE6. Here is my script:
function doAction()
{
var oSource=window.event.srcElement;
var iden=oSource.name;
window.open("/servlet/menus.DBMenuUpdate?dbname=haegens_vva&operation="+iden,"_self");
}
function capture()
{
document.captureEvents(Event.CLICK);
document.onclick=doAction;
document.onchange=saveChange;
}
function saveChange()
{
var oSource=window.event.srcElement;
var naam=oSource.name;
var waarde=oSource.value;
var newobj=document.createElement("input");
var counter=commands.childNodes.length;
newobj.type="hidden";
newobj.name="command"+counter;
newobj.value="Change "+naam+" To "+waarde;
var obj=commands.insertAdjacentElement("beforeEnd",newobj);
}
the function capture() is called here:
<body onload="capture();">
the function doAction() should be called here:
<input type="button" id="cmdVerwijderen12" name="cmdVerwijderen12" onclick="doAction()">
the function saveChange() is called here:
<input name="txtLink110" onChange="saveChange()" type="text" value="Prov_Antwerpen.htm" size="50" maxlength="50">.
Can someone please help me out?