Textbox enter, invokes linkbutton in firefox, not in IE
<p>i have a textbox on my form with a linkbutton next to it.
the textbox' id is textbox1 and the linkbutton is lbSearch</p>

<p>in the page_load event i add:</p>

<pre><code>  this.TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode)
        {
            if ((event.which == 13) || (event.keyCode == 13))                              
            {
                document.getElementById('" + this.lbSearch.ClientID + "').click();
                return false;
            }
        }
        else 
        {
            return true
        }; ");
</code></pre>

<p>and in firefox this works but in internet explorer it doesn't </p>

<p>this is because the linkbutton get's rendered as </p>

<pre><code>     &lt;a href="..."
</code></pre>

<p>how can i resolve this?</p>

<p>without changing the linkbutton to an imagebutton or regular button.</p>

<p>the linkbutton gets rendered like this:</p>

<pre><code>    &lt;a href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$zoeken1$lbSearch", "", true, "search", "", false, true))' id="ctl00_zoeken1_lbSearch"&gt;zoek&lt;/a&gt;
</code></pre>

<p>edit: i tried the following and received the following message:</p>

<pre><code>function onkeydown does not always return a value
rule: 1, column: 243

source:


if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13)) 
{ 
 var link = document.getElementById('ctl00_zoeken1_lbSearch'); 
 __doPostBack(link.id.replace('_','$'),''); 
 return false;
}
else
{
 return true;
}
} 
else
{
return true;
};
</code></pre>
