I am working on a custom prompt box. So far I used a hidden div that is shown on a button click with javascript:
function openPromptBox() {
var pos = FindXY(document.promptForm);
var cont = $('promptContainer');
var searchBox = $('promptBox');
searchBox.style.left = (pos.x - 20) + "px";
searchBox.style.top = (document.body.scrollTop + 100) + "px";
cont.style.display = "block";
}
here is the div:
<div id="promptContainer">
<div id="promptBox">
<table>
<tr>
<td colspan="2">
<input type="text" name="result" id="result" size="25"/>
</td>
</tr>
<tr>
<td>
<input type="button" id="btnOK" value="OK" />
</td>
<td>
<input type="button" id="btnCancel" value="Cancel" />
</td>
</tr>
</table>
</div>
</div>
Now I need to return to the function openPromptBox
the value of textbox result
whenever btnOK
button is clicked. Is there any way to do that?