Hi,
I am trying to use a yahoo search box and open the search results in a new window. I'm having some difficulty understanding how to use variables between my function and my form. can some one tell me what I am doing wrong?
Thanks
I am trying to use a yahoo search box and open the search results in a new window. I'm having some difficulty understanding how to use variables between my function and my form. can some one tell me what I am doing wrong?
Thanks
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title></title>
<script type="text/javascript">
Function SearchYahoo(txt)
{
window.open('[URL unfurl="true"]http://search.yahoo.com/search?p=')[/URL] & txt
}
</script>
</head>
<body>
<!-- Yahoo! Search -->
<form method="get" action="[URL unfurl="true"]http://search.yahoo.com/search">[/URL]
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<div style="border: 1px solid #999; padding: 5px 4px 5px 3px;">
<a href="[URL unfurl="true"]http://search.yahoo.com/">[/URL]
<img src="[URL unfurl="true"]http://us.i1.yimg.com/us.yimg.com/i/us/search/ysan/ysanlogo.gif"[/URL] align="absmiddle"
border="0"></a>
<input type="text" name="p" size="25">
<input type="hidden" name="fr" value="yscpb">
<input type="submit" value="Search" onclick="SearchYahoo(p)"></div>
</td>
</tr>
</table>
</form>
<!-- End Yahoo! Search -->
</body>
</html>