Solved

Popup window with a button

Posted on 2003-12-01
6
315 Views
Last Modified: 2010-04-09
Greetings,

I have an html fragment which creates a link which pops up a window and runs a script in it:

<a href="choose.php"
            onClick="return popup(this, 'IndustryChoose',
                                 '?CallerWin=$winName&Type=Industry&Field=Industry',
                                 'width=250,height=250,scrollbars=no,resizable=yes,toolbar=no,titlebar=no,menubar=no')">
   Add
</a>


Instead of a link, I would like to use a button. I can use <button> to do this of course but I can't think of how to tell the popup to run choose.php, as I did with the <a> tag.

Thanks,

Rich
0
Comment
Question by:RichardFox
6 Comments
 
LVL 5

Accepted Solution

by:
apparition earned 50 total points
ID: 9852209
<input type="button"          value="Add"  onClick="return popup(this, 'IndustryChoose',
                                 '?CallerWin=$winName&Type=Industry&Field=Industry',
                                 'width=250,height=250,scrollbars=no,resizable=yes,toolbar=no,titlebar=no,menubar=no')">
0
 
LVL 17

Expert Comment

by:dorward
ID: 9852666
Links want to be links - but you can style your link to look like a button.

http://tom.me.uk/2002/8/css-buttons.html
0
 

Author Comment

by:RichardFox
ID: 9853863
but there is nothing here to tell the popup which script to run
0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9856168

<input type="button" value="popup" onClick="win=window.open('IndustryChoose.php?CallerWin=$winName&Type=Industry&Field=Industry', '' , 'width=250,height=250,scrollbars=no,resizable=yes,toolbar=no,titlebar=no,menubar=no')">
0
 
LVL 5

Expert Comment

by:apparition
ID: 9858082
GwynforWeb's suggestion is the same as my suggestion
0
 

Author Comment

by:RichardFox
ID: 9858531
Yeah, you're right. I was missing the piece of the puzzle of changing the first parameter to window.open, 'this', to the name of my target script, 'choose.php'. GwynforWeb's answer clarified this for me but nonetheless your answer was right and the first across the line. Thanks folks.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I convert HTML files to .pdf files? 9 57
div to fit another div 8 23
Create tabs to show divs 9 31
Can't get container centered 4 16
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question