Solved

How to open a new page when button is clicked.

Posted on 2003-11-20
2
453 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 dynamically set the form action using jQuery.

863 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

23 Experts available now in Live!

Get 1:1 Help Now