garethr
08-19-2005, 11:05 AM
Hi,
I am trying to have a link from an image which goes to a page:
SearchView&Query= "+ fullname +"
taking the value fullname from a text box.
I am unsure how to do this exactly, as when you use document.write the link gets written when the page loads and can't be changed.
I don't want to use window.open function as it creates a new session which I want to avoid.
Any help would be greatly appreciated
<HTML>
<Title>JS Search</TITLE>
<head>
<script type="text/javascript">
var fullname = "";
function getVar()
{
fullname = document.tim.name.value;
}
</script>
</head>
<body onLoad="getVar();">
<form name="tim">
<input onchange="getVar()" title="Search the staff directory" style ="VERTICAL-ALIGN: 3px" display="inline" maxlength=255 class="ms-searchbox" size=25 name="name" value="Gareth Roberts">
</form>
<script language ="javascript">
var image = '<img border="0" src=image.gif>';
var test1 = image.link("SearchView&Query= "+ fullname +"&SearchOrder=1&Seq=1");
document.write(test1);
</script>
</body></HTML>
I am trying to have a link from an image which goes to a page:
SearchView&Query= "+ fullname +"
taking the value fullname from a text box.
I am unsure how to do this exactly, as when you use document.write the link gets written when the page loads and can't be changed.
I don't want to use window.open function as it creates a new session which I want to avoid.
Any help would be greatly appreciated
<HTML>
<Title>JS Search</TITLE>
<head>
<script type="text/javascript">
var fullname = "";
function getVar()
{
fullname = document.tim.name.value;
}
</script>
</head>
<body onLoad="getVar();">
<form name="tim">
<input onchange="getVar()" title="Search the staff directory" style ="VERTICAL-ALIGN: 3px" display="inline" maxlength=255 class="ms-searchbox" size=25 name="name" value="Gareth Roberts">
</form>
<script language ="javascript">
var image = '<img border="0" src=image.gif>';
var test1 = image.link("SearchView&Query= "+ fullname +"&SearchOrder=1&Seq=1");
document.write(test1);
</script>
</body></HTML>