$(function() {
$('input[name="idcopy"]').blur(function() {
var v = this.value,
a = $('#link'),
p = a.prop('href'),
r = new RegExp('&'+this.name+'=.+'),
d = '&'+this.name+'='+v;
if(v) {
p = ~p.indexOf('&'+this.name) ? p.replace(r, d) : p + d
} else p = p.replace(r, '');
a.prop('href', p);
}).on('input', function() {
this.value = this.value.replace(/\D/g, '')
});
});
<a id="link" href="/reg/live/buyer.php?obj=1810&action=addform">GO</a>
<input name="idcopy" />