Jump to content

When I click on SUBMIT BUTTON


alwaysvaghu

Recommended Posts

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...