Dietmar Meier wrote:
kaeli wrote:
If this is for MSIE only (intranet/CD/HTA/etc), vbscript may allow it
with MsgBox.
From trusted applications like HTAs, WScript.Shell's Popup will work, too:
[...]
To remove the IE-centricity, why not a 'pop-up' div that contains
checkboxes with the relevant items?
The example below writes the value to an input supplied by the call,
but it could just return the selected value.
<style type="text/css">
..pHead, .pTxt
{font-family: arial, sans-serif; font-weight: bold;
background-color: #333366; color: #eeeeff;
margin: 0; padding: 5px 5px 2px 2px;}
..pTxt
{font-weight: normal;}
..pDiv
{color: #333366; background-color: #eeeeff;
position: absolute; border: 1px solid #333366;}
</style>
<script type="text/javascript">
function confirm(){
var a = [];
var i = arguments.length;
while (i-- && (a[i] = arguments[i]) );
var src = a.shift(); // element call came from
var tgt = a.shift(); // element to write value to
var oD = document.createElement('div');
var oP = document.createElement('p');
oD.className = 'pDiv';
oP.className = 'pHead';
oP.appendChild(document.createTextNode(a.shift())) ;
oD.appendChild(oP);
i = a.length;
while (i--){
oI = document.createElement('input');
oI.type = 'checkbox';
oI.value = a[0];
oI.onclick = function () {confClick(this,tgt)};
oD.appendChild(oI);
oD.appendChild(document.createTextNode(a.shift())) ;
oD.appendChild(document.createElement('br'));
}
oD.style.top = tgt.offsetTop + 20 + 'px';
oD.style.left = tgt.offsetLeft + 'px';
document.body.appendChild(oD);
}
function confClick(x,tgt){
tgt.value = x.value;
var z = x.parentNode;
z.parentNode.removeChild(z);
}
</script>
<div style="position: relative; height: 100px"></div>
<form action="">
<input type="text" name="inA" value="blah" size="20"
onblur="confirm(this,this.form.confA,
'Is this chargeable?','yes','no','maybe');">
<input type="input" name="confA" size="5"><br>
<input type="reset">
</form>
--
Rob