I have two elements:
<input type="text" name="pmTo" id="pmTo" onkeyup="offerSuggs('none');" onfocus="showSelect();" onblur="hideSelect();" />
and dynamically created (this is all part of the automatic suggestion program):
$suggString .= '<div name="'.$value.'" id="'.$value.'" class="suggMouseOver" onmouseover="highlightDivs(this);" onmouseout="blurDivs(this);" onclick="fillInput(this);">'.$value.'</div>';
Ok, and then there are event functions that match the onblur of the input element, and then the onclick of the div element:
function hideSelect() { offerSuggs('checkFinal'); document.getElementById('nameSugg').style.display="none"; } function fillInput(elemName) { document.getElementById('pmTo').value=elemName.id; }
EDIT: How to get onclick to properly launch the element they click on without the onblur event hiding the div, which makes onclick pointless? However, I would still like to keep the proposal rejection functionality when the text box loses focus. Thanks.
javascript javascript-events onclick onblur
linus72982
source share