I'm using the code shown below which displays 3 input fields - when you
click on an input field, a DIV is displayed which allows you to select a
task. On clicking the task, it is inserted into the appropriate input field,
and the DIV is hidden again.
I'm using a tooltip script from Dynamic Drive (ommitted for clarity) to show
the task description over the input field, but I am unable to reassign a new
function to the onmouseover event handler of the input field using ...
document.forms["timesheet"].elements[fld].onmouseover=dd rive(tip,300);
Can anyone tell me why this doesn't work (and how to make it work!)?
-----------------------------------------
Rae MacLeman
info@cobwebbery .co.uk
Cobwebbery Web Design
=============== =============== =============== ==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Timeshee t Data Capture Demo</title>
<script language="JavaS cript" type="text/javascript">
<!--
var fld = '';
function setFld(f){
fld = f;
}
function setTip(fld,tip) {
document.forms["timesheet"].elements[fld].onmouseover=dd rive(tip,300);
}
-->
</script>
</head>
<body>
<!-- Create the task picker -->
<div id="picker" style="border: 1px solid red; background-color: #F0F8FF;
padding: 5px; width:260px; visibility: hidden;">
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task001';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';setTip( fld,'Overhaul brakes');">Task
001 - Overhaul braking system</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task002';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 002 - Full service up to
1000cc</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task003';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 003 - Full service
1001-2000cc</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task004';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 004 - Camshaft
replacement</span><br>
</div>
<!-- The data capture form -->
<form action="" name="timesheet " id="timesheet" >
<input onMouseover="dd rivetip('unavai lable', 300)";
onMouseout="hid eddrivetip()" style="cursor:h elp;" type="text" name="task1"
id="task1"
onclick="setFld ('task1');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
<input style="cursor:h elp;" type="text" name="task2" id="task2"
onclick="setFld ('task2');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
<input style="cursor:h elp;" type="text" name="task3" id="task3"
onclick="setFld ('task3');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
</form>
</body>
</html>
--
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.794 / Virus Database: 538 - Release Date: 11/10/04
click on an input field, a DIV is displayed which allows you to select a
task. On clicking the task, it is inserted into the appropriate input field,
and the DIV is hidden again.
I'm using a tooltip script from Dynamic Drive (ommitted for clarity) to show
the task description over the input field, but I am unable to reassign a new
function to the onmouseover event handler of the input field using ...
document.forms["timesheet"].elements[fld].onmouseover=dd rive(tip,300);
Can anyone tell me why this doesn't work (and how to make it work!)?
-----------------------------------------
Rae MacLeman
info@cobwebbery .co.uk
Cobwebbery Web Design
=============== =============== =============== ==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Timeshee t Data Capture Demo</title>
<script language="JavaS cript" type="text/javascript">
<!--
var fld = '';
function setFld(f){
fld = f;
}
function setTip(fld,tip) {
document.forms["timesheet"].elements[fld].onmouseover=dd rive(tip,300);
}
-->
</script>
</head>
<body>
<!-- Create the task picker -->
<div id="picker" style="border: 1px solid red; background-color: #F0F8FF;
padding: 5px; width:260px; visibility: hidden;">
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task001';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';setTip( fld,'Overhaul brakes');">Task
001 - Overhaul braking system</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task002';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 002 - Full service up to
1000cc</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task003';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 003 - Full service
1001-2000cc</span><br>
<span style="cursor: hand;"
onclick="docume nt.getElementBy Id(fld).value=' Task004';docume nt.getElementBy I
d('picker').sty le.visibility=' hidden';">Task 004 - Camshaft
replacement</span><br>
</div>
<!-- The data capture form -->
<form action="" name="timesheet " id="timesheet" >
<input onMouseover="dd rivetip('unavai lable', 300)";
onMouseout="hid eddrivetip()" style="cursor:h elp;" type="text" name="task1"
id="task1"
onclick="setFld ('task1');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
<input style="cursor:h elp;" type="text" name="task2" id="task2"
onclick="setFld ('task2');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
<input style="cursor:h elp;" type="text" name="task3" id="task3"
onclick="setFld ('task3');docum ent.getElementB yId('picker').s tyle.visibility =
'visible';"><br >
</form>
</body>
</html>
--
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.794 / Virus Database: 538 - Release Date: 11/10/04
Comment