Solved

How to open a new page when button is clicked.

Posted on 2003-11-20
2
476 Views
Last Modified: 2008-03-06
Hi there. I need to know how to open a new page (with a variable passed) when a button is clicked. This button is not the main submit button on the form.
0
Comment
Question by:AntonBotes
[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
2 Comments
 
LVL 13

Accepted Solution

by:
lozloz earned 25 total points
ID: 9786766
hi,

this just involves some simple javascript. in the head:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function openwindow() {
  window.open('yourpage.html','mywindow','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=640,height=480')
}
// End -->
</SCRIPT>

and for the button:

<input type="button" value="Open new window" name="open" onClick="openwindow(this.form)">

loz
0
 
LVL 1

Assisted Solution

by:show_source
show_source earned 25 total points
ID: 9787295
Or just

<?php
echo"<form>";
echo"<input type=\"button\" onclick=\"window.open('testpage.php?var=newvar');return false\" value=\"open\">";
echo"</form>";
?>
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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

696 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