Solved

How to open a new page when button is clicked.

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

757 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

20 Experts available now in Live!

Get 1:1 Help Now