wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes how to open a page in same browser in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to open a page in same browser in javascript" Watch "how to open a page in same browser in javascript" New topic
Author

how to open a page in same browser in javascript

Priya Lavti
Ranch Hand

Joined: Oct 11, 2004
Posts: 41
Hi,

I want to open a page in the same browser depending on the selected value of a combo box. The page should be opened only after submit button is closed. Presently I am using window.open(url) method, but it opens the page in new browser. And I tries using window.open(url, _self) but it also didn't help me. here is the script which I am using::

function categorySearch() {
if (form2.catselect[1].selected) {
window.open("catPage1.jsp",_self);
}
if (form2.catselect[2].selected) {
window.open("catPage2.jsp",_self);
}
}

Looking forward for a sloution
Thanks in advance


-Priya
SCJP 5.0
vidhyasagar reddy
Ranch Hand

Joined: Jul 05, 2005
Posts: 40
function categorySearch() {
if (form2.catselect[1].selected) {
document.form2.action="catPage1.jsp";
}
if (form2.catselect[2].selected) {
document.form2.action="catPage1.jsp";
}
document.form2.submit();
}
Priya Lavti
Ranch Hand

Joined: Oct 11, 2004
Posts: 41
It solved my problem
Thanks again!!!
 
jQuery in Action, 2nd edition
 
subject: how to open a page in same browser in javascript
 
Similar Threads
Open a web page in Javascript?
Uploading Single File by Using enctype="multipart/form-data"
IE 6 hide menubar, toolbar in current window
options for opening a new window
location.href while using modal window