<p>The .Net generated code for a form with the "DefaultButton" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). </p>

<p>Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens inside of a &lt;textarea&gt; control. The result is a multiline text area control that cannot be multiline in Firefox as the enter key submits the form instead of creating a new line. </p>

<p>For more information on the bug, <a href="http://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html" rel="noreferrer">read it here</a>.</p>

<p>This could be fixed in Asp.Net 3.0+ but a workaround still has to be created for 2.0. </p>

<p>Any ideas for the lightest workaround (a hack that doesn't look like a hack =D)? The solution in the above link scares me a little as it could easily have unintended side-effects.</p>

For this particular issue, the reason is because javascript generated by 
ASP.NET 2.0 has some IE only notation: event.srcElement is not availabe in 
FireFox (use event.target instead):
```
```
function WebForm_FireDefaultButton(event, target) {
if (!__defaultFired && event.keyCode == 13 && !(event.srcElement && 
(event.srcElement.tagName.toLowerCase() == "textarea"))) {
var defaultButton;
if (__nonMSDOMBrowser) {
defaultButton = document.getElementById(target);
}
else {
defaultButton = document.all[target];
}
if (defaultButton && typeof(defaultButton.click) != 
"undefined") {
__defaultFired = true;
defaultButton.click();
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return false;
}
}
return true;
}
```
```
If we change the first 2 lines into:
```
```
function WebForm_FireDefaultButton(event, target) {
var element = event.target || event.srcElement;
if (!__defaultFired && event.keyCode == 13 && !(element && 
(element.tagName.toLowerCase() == "textarea"))) {
```
```
Put the changed code in a file and then do
```
```
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptInclude("js1", "JScript.js");
}
```
```
Then it will work for both IE and FireFox.
Source:
http://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html