Hello
Can anyone tell me how to make a popup window with javascript from within a php code:
Here is my javascript:
[HTML]<script language="JavaScript">
function win1() {
window.open("Window1","menubar=no,width=460,height =360,toolbar=no");
}
</script>[/HTML]
and here is the php:
[PHP]<?php
print "<a href=" . Chr(34) . "search2.php?" . "JobNbr=" . $jtsstatus['TrackingNbr'] . Chr(34) . ">" . $jtsstatus['TrackingNbr'] . "</a>"; ?>[/PHP]
It is the search2.php that needs to open in a new window.
5 2208
Hello
Can anyone tell me how to make a popup window with javascript from within a php code:
Here is my javascript:
[HTML]<script language="JavaScript">
function win1() {
window.open("Window1","menubar=no,width=460,height =360,toolbar=no");
}
</script>[/HTML]
and here is the php:
[PHP]<?php
print "<a href=" . Chr(34) . "search2.php?" . "JobNbr=" . $jtsstatus['TrackingNbr'] . Chr(34) . ">" . $jtsstatus['TrackingNbr'] . "</a>"; ?>[/PHP]
It is the search2.php that needs to open in a new window.
If you want that in a separate Window then u need not to use window.open.
Just edit using ............!! -
<a href=url_string target = _blank>LInk_name</a>
-
If you want a customized window means the specific Height, Width or any Styles then u have to use window.open.
Then you can use.....!! -
<a href="javascript:void(0)" onclick = open_win(url_string)>Link_Name</a>
-
-
function open_win(url_string)
-
{
-
window.open(url_string,"window_name",styles_you_want_to_customize);
-
}
-
I think you got my point what I want to tell you.
OK.
So Wish you a very Best Of Luck with your Try.
Kind Regards,
Dmjpro.
want a customized window to open, so i tried you second solution, but i am not sure that i am putting in the code in the php in the right way, because nothing happens when i click the link to open the new window. Maybe you can see what is wrong...????
Here is what i did:
Javascript code:
function open_win(search2.php)
{
window.open("search2.php","win","width=400,height= 400");
}
PHP Code:
[PHP]<?php
print "<a href='javascript:void(0)' onclick=" . Chr(34) . "open_win(search2.php?)" . "JobNbr=" . $jtsstatus['TrackingNbr'] . Chr(34) . ">" . $jtsstatus['TrackingNbr'] . "</a>"; ?>[/PHP]
want a customized window to open, so i tried you second solution, but i am not sure that i am putting in the code in the php in the right way, because nothing happens when i click the link to open the new window. Maybe you can see what is wrong...????
Here is what i did:
Javascript code:
function open_win(search2.php)
{
window.open("search2.php","win","width=400,height= 400");
}
PHP Code:
[PHP]<?php
print "<a href='javascript:void(0)' onclick=" . Chr(34) . "open_win(search2.php?)" . "JobNbr=" . $jtsstatus['TrackingNbr'] . Chr(34) . ">" . $jtsstatus['TrackingNbr'] . "</a>"; ?>[/PHP]
Look I am not a PHP man so I am unable to understand the syntax for PHP.
I am a J2EE man.
So I am sending you a sample code try it as I telling you.
Ok. -
<html>
-
<head>
-
<script language=JavaScript>
-
function win_open(url)
-
{
-
window.open(url,"win_"+Math.round(Math.random()*1000),"height:180px,width:500px");
-
}
-
</script>
-
</head>
-
<body>
-
<a href="javascript:void(0)" onclick = "win_open('http://www.google.com/')">Google</a>
-
</body>
-
</html>
-
Try this it will work fine and change the code according to your requirement.
Wish a best of luck with your Try.
Kind regards,
Dmjpro.
Thank you for your code. I will try and post the php issue in the php forum.
Thank you for your code. I will try and post the php issue in the php forum.
You better to do that.
Kind regards,
Dmjpro.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |-|erc |
last post by:
Hi!
Small challenge for you.
The index.php uses this file and calls layout(). Take a look at www.chatty.net this file
draws the chat login box on the right. I traced the CHAT button it submits...
|
by: Obantec Support |
last post by:
Hi
i leached some code and strung together a popup i need for a page with 5
help buttons.
Now i could use 5 scripts and pre-load the values but i would rather get a
better understanding of how...
|
by: Shaun McKinnon |
last post by:
HI...Here's my problem...I have a popup window that loads when i want it to,
but it's not sized properly. I've set the size, but it doesn't seem to
work. I've been on 8 different websites to find...
|
by: Mehmet Gunacti |
last post by:
Hello,
on our homepage, when pressing an anchor tag, a special sized popup
window opens via javascript. but it opens very slowly.
on other web pages, there are also javascript-opened windows,...
|
by: Bill H |
last post by:
I run a dbms application that interfaces with the web. This module creates
a frames page with two frames ('main' and 'mwinfoframe'). All communication
with the dbms is routed through the...
|
by: Jay |
last post by:
I have a situation where the user clicks on a button in a
DataGrid to launch a popup window via javascript. In the
popup window the user does some things that result in
changes to the underlying...
|
by: Rathtap |
last post by:
I want to popup a window from my codebehind. The reason is that during
the postback the code needs to do some validations and to build the
arguments that are passed in the url. How can I achieve...
|
by: clsmith66 |
last post by:
I am building an ASP.NET application where I have been required to make all
the editing screens popup windows within the application. I didn't have any
trouble creating the new windows but only...
|
by: ukrbend |
last post by:
I use an iframe on my home page and everything works perfectly. But
now I decided to add a popups to my page. The popups come not from
within the iframe but from the parent frame. Again, everything...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |