Javascript does not change input field value. Possibly confilct of 2 javascripts

Here is sample http://jsfiddle.net/rigaconnect/gLCjy/14/

Enter something in left top field. Right top field value changes to 1. That is ok.

Then press and hold ctrl and click in left bottom field. Left bottom field value becomes the same as left top field’s value. This is also ok.

But right bottom field value does not change. This is the problem… Actually no idea. Need advice to which direction to go…

If type/copy without using ctrl+click, everything is ok. But with ctrl+click does not work…

Hi,

I simplified your script a little, but this should work:

<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Unbenanntes Dokument</title>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
  </head>

  <body>
    <div>
      <input type="text" id="input1" size="1">
      <input type="text" id="input2" size="1">
    </div>
    <div>
      <input type="text" id="input3" size="1">
      <input type="text" id="input4" size="1">
    </div>

    <script>
      $("#input1").on("change", function(){
        $("#input2").val("1");
      });

      $("#input3").on("click", function(e){
        if(e.ctrlKey){
          $(this).val($("#input1").val());
          $("#input4").val($("#input2").val());
        }
      });
    </script>
  </body>
</html>

Hope that helps.

Thanks! It works!