Solved

Popup window with a button

Posted on 2003-12-01
6
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

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 …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

626 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