Solved

Popup window with a button

Posted on 2003-12-01
6
316 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

839 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