[Javascript] JavaScript Prompt Box
Paul Novitski
paul at novitskisoftware.com
Fri Apr 16 11:56:44 CDT 2004
Mark,
It sounds like you probably want to 'roll your own' prompt box instead of
using the built-in javascript prompt function. Something like:
<div id="PromptBox" style="position: absolute; visibility: hidden;">
<div id="PromptBoxHead">How many copies?</div>
<input id="PromptBoxInput" type=text />
<button onClick="jsProcessPromptBox('true')">OK</button>
<button onClick="jsProcessPromptBox('false')">CANCEL</button>
</div>
<select onChange="jsRevealPromptBox(options[selectedIndex].value)">
<option></option>
<option value="winnt">Windows NT</option>
<option value="win2k">Windows 2000</option>
<option value="winxp">Windows XP</option>
</select>
To reveal the prompt box, position it wherever you want on the screen and
toggle its visibility. Or fix its x/y coordinates in CSS with
#PromptBox{}, where you can also set its colors, borders, etc.
The other alternative is to create a child window with window.open().
Paul
At 09:29 AM 4/16/2004, mark wrote:
>Thanks very much. That's the general idea but I want to see if it's
>possible to control the behaviour of this prompt, i.e. where it appears on
>page, etc.
>Mark.
More information about the Javascript
mailing list