Translate

quarta-feira, 28 de maio de 2014

HTML - Desabilitar um Botão

<html>
  <form id="frm_teste" name="frm_teste" method="post" action="">
<head>
<title></title>
</head>
<body>
<p>
        <input type="button" Class="buttonnew" style="width:110;height:22" id="botao-consultar" name="botao-consultar" value="Consultar" >
        <input name="p_check_desabilitar" type="checkbox" onchange="desabilitar()" /> </span>&nbsp;Desabilitar Botão</p>
    </body>
  </form>

  <script type="text/javascript" src="/jscripts/jquery/jquery-1.6.3.min.js"></script>
  <script type="text/javascript">

  function desabilitar()
         {
            if (document.frm_teste.p_check_desabilitar.checked == true)
             {
               document.getElementById("botao-consultar").disabled = "disabled";
             }
           else
             {
               document.getElementById("botao-consultar").disabled = false;
             }
         }

  </script>

</html>

Nenhum comentário:

Postar um comentário