Wrong event getting called, while adding item into listbox through textbox
<p><img src="http://i.stack.imgur.com/gv59f.png" alt="enter image description here"></p>

<p>I have <code>2 textboxes</code> and <code>2 listbox</code>, with respective add buttons of those.</p>

<p>When I just enter some text in textbox1 and press the enter it gets added into listbox1, as expected from event Add1.</p>

<p>Problem:</p>

<blockquote>
  <p>When I just enter some text in textbox2 and press the enter it gets
  added into listbox1, from event Add1. But it should get added in
  listbox2 from event Add2.</p>
</blockquote>

<p>I checked the tab index after entering text in textbox 2 for both buttons Add1 and Add2 its "Zero".</p>

<p>What can be done? if I have enter text into textbox2, after hiting enter should call Add2 rather than Add1.
<strong>Update:</strong></p>

<pre><code>   $('#textbox1').keypress(function(event){

       var keycode = (event.keyCode ? event.keyCode : event.which);
           if(keycode == '13'){
         alert('You pressed a "enter" key in textbox1');    
             __doPostBack('&lt;%=btnAdd1.UniqueID %&gt;', '');
      }
   });

   $('#textbox2').keypress(function(event){

      var keycode = (event.keyCode ? event.keyCode : event.which);
      if(keycode == '13'){
    alert('You pressed a "enter" key in textbox2'); 
            __doPostBack('&lt;%=btnAdd2.UniqueID %&gt;', '');
      }

   });
</code></pre>

<p>This is also not helping, when I add 1st item using Add2 and then tries to add using Add1.</p>

<p>Can anyone correct me what am I missing?</p>
