Jump to content
Fórum Script Brasil
  • 0

Botão não chama função


Ninja2112

Question

Pessoal, estou quebrando a cabeça com a seguinte situação:

Tenho meu botão "nova consulta" no meu form, assim:

<input type="button" name="btnNvConsult" value="NOVA CONSULTA" onclick="voltarTela(http://localhost/ProjetoEscola/index.php/mnsimulador/simulacao-de-calculo?ID=74)" />  <input type="submit" name="btnEnviar" onclick= "abrirJanela('http://localhost/ProjetoEscola/pagSolicitMatr.php','janela','width=320,height=450')" value="SOLICITAR MATRICULA" />
As funções javascript são essas:
&lt;script language="javascript" type="text/javascript">
function abrirJanela(url,janela,params){
         window.open(url,janela,params);    
    }
    
    function voltarTela(param){
        var end = "";
        end = "'"+param+"'";
        window.open(end,'_self');    
    }
</script>

Ele só executa a ação do submit. No button não dá sinal nem de msg de erro. O que está errado ?

Grato

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Tenta assim:

<input type="button" name="btnNvConsult" value="NOVA CONSULTA" onclick="voltarTela('http://localhost/ProjetoEscola/index.php/mnsimulador/simulacao-de-calculo?ID=74')" />
<input type="submit" name="btnEnviar" onclick= "abrirJanela('http://localhost/ProjetoEscola/pagSolicitMatr.php','janela','width=320,height=450')" value="SOLICITAR MATRICULA" />
<script language="javascript" type="text/javascript">
function abrirJanela(url,janela,params){
         window.open(url,janela,params);    
    }
    function voltarTela(param){
        window.open(param,'_self');
    }
</script>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...