chesneil
10-15-2003, 02:57 AM
I have the code below. When the user puts the mouse over a picture some text appears in the textbox below. For some reason it doesn't work. I thought it was pretty easy...
I'd appreciate if someone could help me out. Thanks
Here's the code:
<script language="JavaScript">
var isReady = false;
function showTitle(which,what){
if (isReady){
document.fm.which.value = what;
}
}
function clearTitle(which){
if (isReady){
document.fm.which.value = '';
}
}
</script>
</head>
<body onload="isReady=true">
<form name="fm">
<table><tr><td>
<img src="images/desktop.gif" onMouseOver="showTitle(desktop,'Titile One')" onMouseOut="clearTitle(desktop)"><br>
<input type="text" size="60" name="desktop">
</td><td>
<img src="images/laptop.gif" onMouseOver="showTitle(laptop,'Title Two')" onMouseOut="clearTitle(laptop)"><br>
<input type="text" size="60" name="laptop">
</td></tr></table>
</form>
</body>
</html>
I'd appreciate if someone could help me out. Thanks
Here's the code:
<script language="JavaScript">
var isReady = false;
function showTitle(which,what){
if (isReady){
document.fm.which.value = what;
}
}
function clearTitle(which){
if (isReady){
document.fm.which.value = '';
}
}
</script>
</head>
<body onload="isReady=true">
<form name="fm">
<table><tr><td>
<img src="images/desktop.gif" onMouseOver="showTitle(desktop,'Titile One')" onMouseOut="clearTitle(desktop)"><br>
<input type="text" size="60" name="desktop">
</td><td>
<img src="images/laptop.gif" onMouseOver="showTitle(laptop,'Title Two')" onMouseOut="clearTitle(laptop)"><br>
<input type="text" size="60" name="laptop">
</td></tr></table>
</form>
</body>
</html>