If I understand your question, you have data in a form. When the form field is changed you want to change a link and pass the value to the new url.
<input type="text" name="z" value="1" onchange="updatelink(this.
value);">
function updatelink(z){
if(z==1){
document.getElementById("w
eblink").s
rc = "
http://www.AnotherSite.com/Index.htm?z=" + z;
} else if (z==2) {
document.getElementById("w
eblink").s
rc = "
http://www.CustomAddress.com/Index.htm?z=" + z;
}
}
<a id="weblink" href="
http://www.CustomAddress.com/Index.htm">