Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Effective PopUp Window 1

Status
Not open for further replies.

chezealot9

Programmer
Jun 17, 2003
50
0
0
US
Hey Guys, On one page Im building I have a button that I would like to open a small window when clicked that basically gives more detailed information and a list box or something, what tools should I look into to do this, or is there an easy way or something?

Thank you greatly for any help!!
 
You can use a twist of the following:

Java:
var myWindow;
function openWin() {
myWindow = window.open('MyPage.aspx?WID=01', 'newWin1', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,minimize=no,copyhistory=no,width=300,height=320,left=50,top=160')
}
function closeWin() {
myWindow.close();
}

attach attribute to button...
....("OnClick","OpenWin();")

or use on mouse-over.., etc:

OnMouseOver='openWin()' onMouseOut='closeWin()'

..and so on...

If you open the window on Click then you'll want to run the "close" function of the opened URL pop up. Something like:

<script language=&quot;Javascript&quot;>
function ReturnDate()
{
window.opener.document.forms[&quot;<%= strFormName %>&quot;].elements[&quot;<%= strCtrlName %>&quot;].value = &quot;<%= strSelectedDate %>&quot;;
window.close();
}
function Close()
{
window.close();
}
</script>

...where here the code is on the opened pop-up which is bringing back a querystring with it...

hopes this helps a little...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top