you might want to try
var n = '';
if(document.formname.inputname.value != '')
{
n = document.formname.inputname.value;
}
which will make n equal to what's in the input box. I also think you'll need an onchange even handler on the input for this to work. I don't know much javascript, but...
Code:
<script language="javascript">
function link(var_input)
{
if(document.formname.var_input.value != '')
{
return document.formname.var_input.value;
}
}
</script>
<a href="" id="link1">sdfsdf</a>
<input type="text" onchange="link1.href = link(this)">
Like Dean said, it's the basic principle. I don't expect the code to work. I don't know the objects/properties/methods to use. Perhaps someone with a bit more javascript knowlege can help.
The function first checks if the input is not empty, and if it isn't it returns the value of the input. When making the link you give it a name (link1) which you will then use to identify that link. In the input field, use the onchange event handler, so when someone types something in the input box, you give link1 the value entered in the input box.