SQL PHP HTML ASP JavaScript articles and free scripts to download

Opening a small (or child ) window from a main ( or parent ) window

We can open a small window known as child window by clicking a button or a link or a image of a main window. We can control the width, height and location ( alignment from top left corner of the screen ) of the small window from the main window. Here we can control the status bar, tool bar and resize the child window from the main window. By changing the value of status to 1 form 0 (status=1;) we can display the status bar for the child window. Same way by making the toolbar=1; we can display the tool bars for the small window. We can change the value of left to position the window horizontally. If we make the value of left to 0 like left=0; to align the window to left edge of the screen. Same way by making the top=0; we can place the window at the top of the screen. Don't forget to refresh the parent window every time you change the parameters. Here is the code at the parent window to display the link. Click the demo link to see how the window opens.

Click here to open the child window

Here is the code of the above link

<a href="javascript:void(0);"
NAME="My Window Name" title=" My title here "
onClick=window.open("window-child.html","Ratting","width=550,height=170,0,status=0,");>Click here to open the child window</a>

Here is a button to open the same window



Here is the code of this button

<input type=button onClick=window.open("window-child.html","Ratting","width=550,
height=170,left=150,top=200,toolbar=0,status=0,"); value="Open Window">

Take care of line break in above code.( Remove )

Scrollbar on child window

We can add scroll bar to child window by adding scrollbars=1 while opening the window. Here is the modified code.

<a href="javascript:void(0);"
NAME="My Window Name" title=" My title here "
onClick=window.open("window-child.html","Ratting","width=550,height=170,0,status=0,scrollbars=1");>Click here to open the child window</a>

Click here to open the child window
Google+

Thangavel20-08-2012
thank you:friend:)how to pass the value from child window to parent window
Peter 25-08-2012
Thank you! This helped me so much
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked




Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer