propriété d'un bouton

Répondre
sparh
sparh
Déconnecté
Webmaster en herbe
salut;
je voudrai qu'un bouton permette d'ouvrir une popup!
J'y arrive pour un lien classique mais pas pour un bouton?
Voilà mon code:
  1. var newWin = null;
  2. function closeWin(){
  3.    if (newWin != null){
  4.       if(!newWin.closed)
  5.          newWin.close();
  6.    }
  7. }
  8.  
  9. function popUp(strURL,strType,strHeight,strWidth) {
  10. closeWin();
  11. var strOptions="";
  12. if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
  13. if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
  14. if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
  15. newWin = window.open(strURL, 'newWin', strOptions);
  16. newWin.focus();
  17. }
  18.  

  1. <form name"record" action="record.php" target="popUp" method="post"/>
  2.          <input type="hidden" name="Jeu" value="<?php echo $row['jeux'] ?>"/>
  3.          <input name="submit" type="submit" value="Enregistrez votre record" oncsubmit="popUp(record.php,'fixed',75,75,'scrollbars=0,location=0,status=0,resizable=0,toolbar=0,menubar=0');return false;"/>
  4.          </form> 

Pour un bouton ca marche pas!!
  1. <a href="<?php echo $row['adresse'] ?>" onclick="popUp(this.href,'fixed',400,608);return false;" title="<?php echo $row['jeux'] ?>">Cliquez jouer &agrave;<?php echo $row['jeux'] ?>en plus grand</a></p> 
Pour un lien classique, ca marche!!
Voilà si vous avez des idées pour m'aider?
LA GLOBULE
LA GLOBULE
Déconnecté
111 111 111 x 111 111 111 = 12 345 678 987 654 321
Je vois pas l'interet du formulaire en fait : pourquoi ne pas passer la valeur du bouton caché directement en GET avec un record.php?Jeu=<?php echo $row['jeux'] ?> ?

Comme ça, avec un onclick, c'est torché :) (si tu veux vraiment le faire en POST, ca va etre un peu plus chiant)
Répondre
Accès rapide :

Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Breizh Blog