alwaysvaghu Posted November 11, 2005 Share Posted November 11, 2005 Helo Frnds...We use submit buttons in html..see here<FORM NAME=FORM1 ACTION="file name" METHOD="GET"> <INPUT TYPE=SUBMIT></FORM>when we click on that it will take us to other url("filename")..in that window..I WANT TO OPEN THAT in OTHER WINDOW....???How Can I do that..... Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 I have used target="_blank"but this way msg is comin that POPUP is blocked from the page <FORM NAME=FORM1 ACTION="file name" METHOD="GET" target="_blank"><INPUT TYPE=SUBMIT></FORM> Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi, Use this,Put Like this<INPUT NAME="Open" TYPE="Button" ID="Open" OnClick="window.open(Filename)">In window.open function will open file Whatever u want Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 no i cant do that..bcaz the destination file must be in action=""bcaz i m using php and it is carrying...data to that file Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi, SoWhat YaaarU can stii useVijay Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi,try with this and convert it into ur requirement<html><head><script type="text/javascript">function open_win() {window.open("http://www.w3schools.com")}</script></head><body><form><input type=button value="Open Window" onclick="open_win()"></form></body></html>And U can also write in Action part of it SomeFile.php<form name action="SomeFile.php"></form>Vijay Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 so u r telling that i have to code like thisand it will open: http://www.w3schools.com/somefile.php////////////////////////////////////<html><head><script type="text/javascript">function open_win() {window.open("http://www.w3schools.com")}</script></head><body><form action="SomeFile.php"><input type=button value="Open Window" onclick="open_win()"></form></body></html>////////////// Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi YAaarraIt's too SimpleUse this Functionwindow.open("http://www.w3schools.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")Or<form Action="SomeFile.php">//write Ur Code here</form><html><head><script type="text/javascript">function open_win(){window.open("http://www.w3schools.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")}</script></head><body><form><input type="button" value="Open Window" onclick="open_win()"></form></body></html> Link to comment Share on other sites More sharing options...
Skemcin Posted November 11, 2005 Share Posted November 11, 2005 omg - why do people want to complicate things so much? it only makes going back to the code that much more difficult. <FORM NAME=FORM1 ACTION="file name" METHOD="GET" TARGET="_blank"><INPUT TYPE=SUBMIT></FORM>that's all you need. Now, if you need to control the size, placement, and structure of the new window, then fine use javascript. But remember, there are still people that have javascript turned off and many are starting to use the expanded functionality offered in popup blockers which would catch this.Keep It Simple Sillythis method should not be blocked by a popup blocker - it uses standard HTML code. If this is being blocked, then the other suggestions made here will be too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now