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=ddrive(tip,300);
Can anyone tell me why this doesn't work (and how to make it work!)?
-----------------------------------------
Rae MacLeman
in**@cobwebbery.co.uk
Cobwebbery Web Design
================================================== =====
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Timesheet Data Capture Demo</title>
<script language="JavaScript" type="text/javascript">
<!--
var fld = '';
function setFld(f){
fld = f;
}
function setTip(fld,tip){
document.forms["timesheet"].elements[fld].onmouseover=ddrive(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="document.getElementById(fld).value='Task0 01';document.getElementByI
d('picker').style.visibility='hidden';setTip(fld,' Overhaul brakes');">Task
001 - Overhaul braking system</span><br>
<span style="cursor: hand;"
onclick="document.getElementById(fld).value='Task0 02';document.getElementByI
d('picker').style.visibility='hidden';">Task 002 - Full service up to
1000cc</span><br>
<span style="cursor: hand;"
onclick="document.getElementById(fld).value='Task0 03';document.getElementByI
d('picker').style.visibility='hidden';">Task 003 - Full service
1001-2000cc</span><br>
<span style="cursor: hand;"
onclick="document.getElementById(fld).value='Task0 04';document.getElementByI
d('picker').style.visibility='hidden';">Task 004 - Camshaft
replacement</span><br>
</div>
<!-- The data capture form -->
<form action="" name="timesheet" id="timesheet">
<input onMouseover="ddrivetip('unavailable', 300)";
onMouseout="hideddrivetip()" style="cursor:help;" type="text" name="task1"
id="task1"
onclick="setFld('task1');document.getElementById(' picker').style.visibility=
'visible';"><br>
<input style="cursor:help;" type="text" name="task2" id="task2"
onclick="setFld('task2');document.getElementById(' picker').style.visibility=
'visible';"><br>
<input style="cursor:help;" type="text" name="task3" id="task3"
onclick="setFld('task3');document.getElementById(' picker').style.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