PDA

View Full Version : Javascript - enable 'open in a new window'


arc919
12-19-2006, 09:13 PM
Hi

I have some links in Javascript which work, however when one tries to open them in a new window, they don't work. The URL in the address bar becomes 'javascript:%functionname()'.

Is there any way to enable the 'open in a new window'?

(I don't mean making it always open in a new window by default)

Cheers!!

Jon Hanlon
12-20-2006, 04:53 PM
Please post your code

arc919
12-20-2006, 09:31 PM
<form name="myform" action="handle-data.php">
Search: <input type='text' name='query'>
<A href="javascript: submitform()">Search</A>
</form>
<SCRIPT language="JavaScript">
function submitform()
{
document.myform.submit();
}
</SCRIPT>

Jon Hanlon
12-20-2006, 11:32 PM
<A href="#" onclick="submitform();return false;">Search</A>

arc919
12-21-2006, 12:11 AM
works pretty good! thank you :D