Forum Moderators: phranque
Is there a way I can open a page in the current window when I do a form submit?
Here is my code.
</HEAD>
<BODY>
<form name="airForm" id="airForm" onsubmit=fun()>
<input type="submit" value="Submit">
</form>
</BODY>
</HTML>
<script language="javascript">
function fun(){
window.open("http://google.com", "_self");
}
</script>
It works fine if I change the 'submit' to a 'button'.
<form name="airForm" id="airForm" >
<input type="button" value="Submit" onClick=fun()>
</form>
Thanks for any help.
Abhilash
[edited by: Gopinath at 11:04 am (utc) on Feb. 17, 2009]