A: 

jQuery allows you to bind multiple click event handlers. You will need to unbind the previous click event handler using .unbind before adding the second one (or both will fire, as you experienced):

$("a").unbind("click");

So your code could read:

$('.inputWithReplace').focus(function(){ 
    $("a").unbind("click").click(function(){  
     $('.inputWithReplace').val($(this).html()); 
         });  
});
Chris Pebble
20 minutes to write the stupid question, 1 minute to get the answer. I love you stackoverflow. Thanks Chris.
kevtrout
A: 

You can shorten your code to

$(document).ready(function(){
  $('input:text').focus(function(e){ 
      tagSelector(e.target);
  });
});

function tagSelector(elem) {
  $("a").unbind('click').click(function(e){  
    $(elem).val($(e.target).text()); 
  });  
}

You might need to use a more specific selector for the inputs, I'll leave that as an exercise for you to decide :)

EDIT:

or even this

$(function(){
  $('input:text').focus(tagSelector);
});

function tagSelector(e) {
  $("a").unbind('click').click(function(){  
    $(e.target).val($(this).text()); 
  });  
}
Russ Cam
Yeah, the anchor has a class I use as a selector. I deleted it to keep the example clear. Same with the names on the inputs.
kevtrout