Pop-up new window (without nav tools - such as back but etc)
Moderator: General Moderators
Pop-up new window (without nav tools - such as back but etc)
How do you make a link start a new window which pops up - without the normal navigation tools which you find in a normal browser window.
I want the pop-up window to have a form in it, which enables the user to enter information, and then submit the form. The window should be set at a specific size (only small)
(this pop-up will take the role of a dialog box, which you might find in a windows application)
I want the pop-up window to have a form in it, which enables the user to enter information, and then submit the form. The window should be set at a specific size (only small)
(this pop-up will take the role of a dialog box, which you might find in a windows application)
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
Code: Select all
<script type="text/javascript">
window.open("page.php", "", "left=0, top=0, width=300, height=300, resizable=no, menubar=no, toolbar=no, location=no, status=no");
</script>-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
its all html/javascript
i never really learnt much javascript, but from what i know, it'd be something like this:
like that? (not sure..)
i never really learnt much javascript, but from what i know, it'd be something like this:
Code: Select all
<html>
<head>
<script type="text/javascript">
function yourfunction() {
window.open("page.php", "", "left=0, top=0, width=300, height=300, resizable=no, menubar=no, toolbar=no, location=no, status=no");
}
</script>
</head>
<body>
<a href="javascript:onclick(yourfunction)"><img src="button.gif"></a>
</body>
</html>now - getting the original page to refresh
Hi, I got the above code working..
At the moment, I have a button in a.php, and upon clicking, it window.open() a new window(b.php), containing a form. The form posts variables back to a.php, however, the new window loads a.php, containing the new variables, but instead of this - I want the first window to load a.php. After this, I want to close the new window, which I can do easy by window.close();
So, how can I make the action of the form to load a .php file in a different window other than the current window?
At the moment, I have a button in a.php, and upon clicking, it window.open() a new window(b.php), containing a form. The form posts variables back to a.php, however, the new window loads a.php, containing the new variables, but instead of this - I want the first window to load a.php. After this, I want to close the new window, which I can do easy by window.close();
So, how can I make the action of the form to load a .php file in a different window other than the current window?
To put it simply, you don't.billy_022 wrote:So, how can I make the action of the form to load a .php file in a different window other than the current window?
What you have to do is send the form (which is in the pop-up window) to another file in the pop-up file.
Now the trick is this. You need to get the PHP page that check the form to do one thing if the form is ok and another thing if it's not.
If the form is ok then you need to get the PHP page to write some javascript to the page. If the form is not ok then PHP will need to either display an error message or go back to the form.
The javascript would look something like this...
Code: Select all
<script type="text/javascript">
window.opener.location.href = "thePage.php";
window.close();
</script>
[/close]
The main window that launched the pop-up window will go to whatever page you change "thePage.php" to. And obviously the window.close() bit will close the pop-up window.