Solved

Popup window with a button

Posted on 2003-12-01
6
309 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
Comment Utility
<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
Comment Utility
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
Comment Utility
but there is nothing here to tell the popup which script to run
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility

<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
Comment Utility
GwynforWeb's suggestion is the same as my suggestion
0
 

Author Comment

by:RichardFox
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now