Solved

Popup window with a button

Posted on 2003-12-01
6
320 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use Mid in Html 6 35
Making Table Thru ASP Response.write 5 39
disable open new tab with right mouse click in <a> tag 3 42
Can't Find the Homepage on my site 4 47
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 discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

752 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