October 25th, 2012, 03:32 PM
Open page in the same window
I need to open a new page in the same window when clicked on submit button. Below is my function code.
With window.open(), i can open the page in a new window.
I tried window.open("xxx.jsp",_self) and window.location.href = "xxx.jsp" but can't open the new xxx.jsp page.
can some one help me how to open it in the same page.
if(form.username.value == "" || form.password.value == "")
else if(form.username.value == "xxx" && form.password.value == "xxx")
//window.location.href = "xxx.jsp"
October 25th, 2012, 04:13 PM
You wouldn't use window.open() to submit the form to the same page; you would just submit the form values to your current page. Which if you write your server side code correctly... your server side code will get your form values; once the page is submitted to itself.