Web Hosting Talk







View Full Version : Javascript question


Hostlead
06-20-2005, 01:25 PM
Hello,

Can somebody explain why the following link opens in a new window? What do I need to change for it to open in the same window?

<input type="image" src="images/go.gif" onclick= "javascript:document.searchFrm.action='result.php';document.searchFrm.submit();" border="0">

TIA

HL

Burhan
06-22-2005, 09:40 AM
add target="_self" to it -- might work.

xelav
06-22-2005, 01:28 PM
i'm also interested, why it's opens in new window?

Hostlead
06-23-2005, 11:35 AM
Originally posted by fyrestrtr
add target="_self" to it -- might work.

tried that. not working.

HL

Hostlead
06-23-2005, 02:42 PM
ok I fixed it by recreating the whole php file. Apparently the problem was not in the above quote code, but elsewhere.

HL

tiamak
06-23-2005, 04:34 PM
let me guess :) problem was somewhere inside <Form ...> tag ? :D

btw this ...

<input type="image" src="images/go.gif" onclick= "
javascript:
document.searchFrm.action='result.php';
document.searchFrm.target='_self';
document.searchFrm.submit();
" border="0">

... should also work

well maybe if you have already name for current window you could replace _self with this name :)