[Javascript] pb de fermeture de popup
Fermé
frederic92
Messages postés
23
Date d'inscription
lundi 21 novembre 2005
Statut
Membre
Dernière intervention
3 avril 2006
-
22 mars 2006 à 17:42
Utilisateur anonyme - 4 avril 2006 à 08:37
Utilisateur anonyme - 4 avril 2006 à 08:37
A voir également:
- [Javascript] pb de fermeture de popup
- Telecharger javascript - Télécharger - Langages
- Forcer la fermeture d'un programme - Guide
- Sytadin fermeture - Télécharger - Transports & Cartes
- Frais de fermeture compte paypal - Guide
- Annuler fermeture onglet chrome - Guide
3 réponses
Utilisateur anonyme
30 mars 2006 à 10:22
30 mars 2006 à 10:22
Mais ça m'a tout l'air d'être un TP, ça? Et toute la classe se donne RV sur CCM!
Va voir ici, je viens de répondre à un de tes "collègues" me semble-t-il...
https://forums.commentcamarche.net/forum/affich-2062006-javascript-controle-et-verif-form
>:-(
HackTrack
Va voir ici, je viens de répondre à un de tes "collègues" me semble-t-il...
https://forums.commentcamarche.net/forum/affich-2062006-javascript-controle-et-verif-form
>:-(
HackTrack
frederic92
Messages postés
23
Date d'inscription
lundi 21 novembre 2005
Statut
Membre
Dernière intervention
3 avril 2006
6
3 avril 2006 à 11:10
3 avril 2006 à 11:10
moi j'ai un ti pb avec ton script HackTrack !
j'ouvre le formulaire dans un popup et je n'arrive pas la validation de ce formulaire fermer la popup de validation et la popup de formulaire
comment faire ?
merci pouir votre aide
Popup.php
Et voici juste le script javascript d’ouverture de la popup de ma page index2.html
j'ouvre le formulaire dans un popup et je n'arrive pas la validation de ce formulaire fermer la popup de validation et la popup de formulaire
comment faire ?
merci pouir votre aide
Popup.php
<html> <head> <script language="javascript" type="text/javascript"> function verif() { var nom = document.formulaire.nom.value; if (document.formulaire.nom.value == "") { alert ('Veuillez entrer votre nom'); document.formulaire.nom.focus(); return false; } if(document.formulaire.prenom.value == "") { alert ('Veuillez entrer votre prénom'); document.formulaire.prenom.focus(); return false; } if(document.formulaire.matricule.value == "") { alert ('Veuillez entrer votre matricule'); document.formulaire.matricule.focus(); return false; } if(document.formulaire.matricule.value.length != 4) { alert ('Le matricule doit comporter 4 chiffres'); document.formulaire.matricule.focus(); return false; } if(document.formulaire.telephone.value == "") { alert ('Veuillez entrer un n° de téléphone'); document.formulaire.telephone.focus(); return false; } if(document.formulaire.telephone.value.length != 6) { alert ('Le n° de téléphone doit comporter 6 chiffres'); document.formulaire.telephone.focus(); return false; } else { if(window.document.all('flag').innerHTML="false"){ resum(); return false; }else{ return true; } } } function resum(){ html= ""; html += " <head>"; html += " <style>"; html += " body, table, tr,td{"; html += " background-color: #FFFFCC;"; html += " color: #009900;"; html += " font-family: Verdana, Arial, Courrier;"; html += " font-size: 10px;"; html += " }"; html += " </style>"; html += " </head>"; html += " <body>"; html += "<i>Merci de prendre le temps de vérifier ce que vous venez de saisir:<br> ( coordonnées, téléphone ou e-mail et la date).</i>"; html += "<p/><strong> Merci !</strong><p/>"; html += " <table>"; html += " <tr>"; html += " <td><b>Nom</b></td>"; html += " <td>: "; html += document.formulaire.nom.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b>Prénom</b></td>"; html += " <td>: "; html += document.formulaire.prenom.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b<Matricule</b></td>"; html += " <td>: "; html += document.formulaire.matricule.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b>Téléphone</td>"; html += " <td>: "; html += document.formulaire.telephone.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b>E-mail</b></td>"; html += " <td>: "; html += document.formulaire.courriel.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b>Date choisie</b></td>"; html += " <td>: "; html += document.formulaire.select.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td><b>Commentaire éventuel</b></td>"; html += " <td>: "; html += document.formulaire.textarea.value; html += " </td>"; html += " </tr>"; html += " <tr>"; html += " <td colspan='2'>"; html += " <button onclick='window.opener.document.all(\"flag\").innerHTML=\"true\";window.opener.document.formulaire.submit();self.close();'>Je confirme</button>"; html += " <button onclick='self.close();'>Je veux modifier</button>"; html += " </td>"; html += " </tr>"; html += " <table>"; html += " </body>"; Fenetreresum = window.open('','Vérification','scrollbars=no,resizable=no,toolbar=no,status=no,top=220,left=250,width=420,height=300') Fenetreresum.document.write(html); } </script> </head> <body> <form name="formulaire" method="post" action="index2.php"> <table> <tr> <td>Nom:</td> <td><input type="" name="nom" value="nom" /></td> </tr> <tr> <td>Prénom:</td> <td><input type="" name="prenom" value="fred" /></td> </tr> <tr> <td>Matricule:</td> <td><input type="" name="matricule" value="1234" /></td> </tr> <tr> <td>Téléphone:</td> <td><input type="" name="telephone" value="123456" /></td> </tr> <tr> <td>Courriel:</td> <td><input type="" name="courriel" value="Mon_mail@fai.fr" /></td> </tr> <tr> <td>Date:</td> <td> <select name="select"> <option value="01/04/2006">01/04/2006</option> <option value="01/10/2006">01/10/2006</option> </select> </tr> <tr> <td>Commentaire:</td> <td><textarea cols="40" rows="5" name="textarea" value="">Juste pour tester.</textarea></td> </tr> <tr> <td colspan="2"><input type="submit" onclick="javascript: return verif();"/> <input type="reset"/> <td colspan='2'>"; </td> </tr> </table> </form> <div id="flag" name="flag" style="display: none;">false</div> </body> </html>
Et voici juste le script javascript d’ouverture de la popup de ma page index2.html
</script> <script language="javascript"> function popupcentree(page,largeur,hauteur,options) { var top=(screen.height-hauteur)/2; var left=(screen.width-largeur)/2; window.open(page,"popup","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); } </script>
Utilisateur anonyme
4 avril 2006 à 08:37
4 avril 2006 à 08:37
Salut!
Dans ta page popup.php, remplace:
par:
;-)
HackTrack
Dans ta page popup.php, remplace:
<body>
par:
<body onunload="javascript:self.close();">
;-)
HackTrack