aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes target= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "target="_blank" attribute in form tag" Watch "target="_blank" attribute in form tag" New topic
Author

target="_blank" attribute in form tag

kashif iftikhar
Ranch Hand

Joined: Aug 21, 2001
Posts: 43
in the form tag there is a attribute "target" its values are _blank,_self extra.....
when we give _blank value it open action page in new window.
my question is can we set that new window attributes.
like
scrollbar="no",
menubar="no"
left=200
top=200
width
hight
extra.............
if yes please tell me.
my second problem is also related to this one.
i have a form like this.
<form action=page1.jsp target="_blank" name="drive" method="post">
<input type="text" name="products" value="shirts">
<input type"submit" name="submit1" value="delete" onClick='drive.action="thisPAge.jsp">
<input type"submit" name="submit2" value="properties" onClick='drive.action="newWindowPage.jsp">
when i click any of the submit button it open action page in new window which it should.
but i want that when i click first button(submit1) it must open requested page in same window and when i click second button(submit2) it must open it in new window with attributes that i write in first question.
what change should i make in this form
thanks
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

I dont know on your first question.
On your second question, change one of your inputs from type=submit to type=button and use a onclick event handler.
also sometimes you can use two forms. but i think you need to change one to type=button
------------------
Dont blindly believe everything I say.


SCJP
Visit my download page
Aaron Webb
Greenhorn

Joined: Aug 16, 2001
Posts: 17
This should work for your first question. I use it frequently.
function doWindow() {
someWin = window.open("","win1","width=780,height=520,scrollbars=yes,resizable=yes,menubar=no,statusbar=yes");
document.printForm.submit();
}
....
<form name="printForm" action="something.html" target="win1" method="post">
<input type="text" name="text1" value="">
<input type="button value="Click me!" onClick="doWindow()">
</form>
When the button is pressed it will open the new window and then call the submit method of the form and the form will submit to the new opened window based on the target attribute.
 
wood burning stoves
 
subject: target="_blank" attribute in form tag