﻿// FUNCTION JScript File

/// <summary>
///  CRIAR BOTÃO DEFAULT ENTER
/// </summary>
/// <param name="BUTTON">CLIENTID DO BOTAO</param>
/// <param name="e">TECLA CLICADA</param>
/// COMO USAR:
/// TextBox1.Attributes.Add("onkeypress", "return clickButton(event,'" + Button1.ClientID + "')");
/// <input name="TextBox1" type="text" id="TextBox1" onkeypress="return clickButton(event,'Button1')"  />

function clickButton(e, buttonid){ 
        
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
} 
    
///******************************************************************************************************


