obamaself Posted July 2, 2012 at 10:59 AM Report Share #466774 Posted July 2, 2012 at 10:59 AM (edited) Bom dia,há maneira de mandar um alerta com resposta de sim e não?Exemplo: http://img837.imageshack.us/img837/6658/alertat.jpg Edited July 2, 2012 at 10:14 PM by brunoais Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted July 2, 2012 at 11:23 AM Report Share #466778 Posted July 2, 2012 at 11:23 AM sim, mas como isso é uma ação do browser (logo do lado do cliente), não é feito com PHP mas sim Javsscript esperimenta: if(confirm('Pretende guardar antes de continuar ?')) { // guardar } else { // não guardar } IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
brunoais Posted July 2, 2012 at 12:08 PM Report Share #466790 Posted July 2, 2012 at 12:08 PM Em php? impossível. "[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31 Life is a genetically transmitted disease, induced by sex, with death rate of 100%. Link to comment Share on other sites More sharing options...
obamaself Posted July 2, 2012 at 12:30 PM Author Report Share #466792 Posted July 2, 2012 at 12:30 PM (edited) usei: echo '<a href="grupos.php?grupo='.$cod_grupo.'" '; echo 'onClick="javascript:return confirm(\'Tem a certeza de que pretende eliminar?\')">'; echo "<img border=\"0\" src=\"../images/Sair.png\" alt=\"Eliminar\" title=\"Eliminar\"></a></td>"; Funciona perfeitamente 🙂 Obrigada. Edited July 2, 2012 at 12:30 PM by obamaself Link to comment Share on other sites More sharing options...
KTachyon Posted July 2, 2012 at 12:35 PM Report Share #466793 Posted July 2, 2012 at 12:35 PM Estás a utilizar o echo para escrever JavaScript para a página... Para além de estares a adicionar overhead ao processamento da página, estás a colocar mais código (e mais confuso e difícil de manter) que se escrevesses isso directamente no HTML... 1 Report “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -- Tony Hoare Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now