Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1120 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  --- Desactiver un bouton ---

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

--- Desactiver un bouton ---

n°1482604
gregm54
Posté le 27-11-2006 à 21:08:49  profilanswer
 

Bonsoir,
J'aimerais qu'une fois cliqué, un bouton se grise et se desactive pour que l'on ne puisse plus générer de phrases!
Voici un code pour génerer des phrases qui est pas mal fait, je demande juste a savoir comment desactiver le bouton une fois qu'il aura été cliqué!
 

Code :
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  4. <title>Nouvelle page 1</title>
  5. </head>
  6. <body>
  7. &nbsp;<form name="scriptform"><input name="scriptinput" size=70 style="border-width:1px solid black;font:Arial"> <input type="button" value="Random" onClick="randomdisplay()"></form>
  8. <script>
  9. //Satirical Punch Line Script- by javascriptkit.com (text by Colin Lingle)
  10. //Visit JavaScript Kit (http://javascriptkit.com) for script
  11. //Credit must stay intact for use
  12. quotes = new Array();
  13. quotes[0]="Warning: Dates in Calendar are closer than they appear.";
  14. quotes[1]="Daddy, why doesn't this magnet pick up this floppy disk?"
  15. quotes[2]="Give me ambiguity or give me something else."
  16. quotes[3]="I.R.S.: We've got what it takes to take what you've got!"
  17. quotes[4]="We are born naked, wet and hungry.  Then things get worse."
  18. quotes[5]="Pentiums melt in your PC, not in your hand."
  19. quotes[6]="Suicidal twin kills sister by mistake!"
  20. quotes[7]="Did anyone see my lost carrier?"
  21. quotes[8]="Make it idiot proof and someone will make a better idiot."
  22. quotes[9]="I'm not a complete idiot, some parts are missing!"
  23. quotes[10]="He who laughs last thinks slowest!"
  24. quotes[11]="Always remember you're unique, just like everyone else."
  25. quotes[12]="Save the whales, collect the whole set"
  26. quotes[13]="A flashlight is a case for holding dead batteries."
  27. quotes[14]="Lottery: A tax on people who are bad at math."
  28. quotes[15]="There's too much blood in my caffeine system."
  29. quotes[16]="Artificial Intelligence usually beats real stupidity."
  30. quotes[17]="Hard work has a future payoff.  Laziness pays off now."
  31. quotes[18]="Friends help you move. Real friends help you move bodies."
  32. quotes[19]="I wont rise to the occaasion, but I'll slide over to it."
  33. quotes[20]="Ever notice how fast Windows runs?  Neither did I."
  34. quotes[21]="Double your drive space - delete Windows!"
  35. quotes[22]="What is a free gift ? Aren't all gifts free?"
  36. quotes[23]="If ignorance is bliss, you must be orgasmic."
  37. quotes[24]="Very funny, Scotty. Now beam down my clothes."
  38. quotes[25]="Puritanism: The haunting fear that someone, somewhere may be happy."
  39. quotes[26]="Consciousness: that annoying time between naps."
  40. quotes[27]="Oops. My brain just hit a bad sector."
  41. quotes[28]="I used to have a handle on life, then it broke."
  42. quotes[29]="Don't take life too seriously, you won't get out alive."
  43. quotes[30]="I don't suffer from insanity.  I enjoy every minute of it."
  44. quotes[31]="A pedestrian hit me and went under my car."
  45. quotes[32]="Better to understand a little than to misunderstand a lot."
  46. quotes[33]="The gene pool could use a little chlorine."
  47. quotes[34]="When there's a will, I want to be in it."
  48. quotes[35]="Okay, who put a stop payment on my reality check?"
  49. quotes[36]="Few women admit their age.  Few men act theirs."
  50. quotes[37]="I'm as confused as a baby in a topless bar."
  51. quotes[38]="We have enough youth, how about a fountain of SMART?"
  52. quotes[39]="All generalizations are false, including this one."
  53. quotes[40]="Change is inevitable, except from a vending machine."
  54. quotes[41]="C program run.  C program crash.  C programmer quit."
  55. quotes[42]="Criminal Lawyer is a redundancy."
  56. quotes[43]="640K ought to be enough for anybody. - Bill Gates 81"
  57. quotes[44]="90% of all statistics are made up"
  58. quotes[45]="A man needs a good memory after he has lied."
  59. quotes[46]="A little work, a little sleep, a little love and it is all over."
  60. quotes[47]="A lot of people mistake a short memory for a clear conscience."
  61. quotes[48]="Apple copyright 6024 b.c., Adam & Eve"
  62. quotes[49]="Apple Copyright 1767, Sir Isaac Newton."
  63. quotes[50]="Bad knee, gotta run - Pat Buchanan to his draft board"
  64. quotes[51]="Beam me aboard, Scotty..... Sure. Will a 2x10 do?"
  65. quotes[52]="Beulah, peel me a grape."
  66. quotes[53]="Bother, said Pooh as the brakes went out!"
  67. quotes[54]="Build a watch in 179 easy steps - by C. Forsberg."
  68. quotes[55]="C++ should have been called B"
  69. quotes[56]="COINCIDENCE happens."
  70. quotes[57]="Calvin, we will not have an anatomically correct snowman!"
  71. quotes[58]="Careful.  We don't want to learn from this. -- Calvin"
  72. quotes[59]="Energizer Bunny Arrested! Charged with battery."
  73. function randomdisplay(){
  74. randomquote=quotes[Math.floor(Math.random()*quotes.length)]
  75. document.scriptform.scriptinput.value=randomquote
  76. }
  77. setTimeout("randomdisplay()",100)
  78. </script>
  79. <p align="center"><font face="arial" size="-2">This free script provided by</font><br>
  80. <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
  81. Kit</a></font></p></body>
  82. </html>


 
Merci d'avance,  ;)

mood
Publicité
Posté le 27-11-2006 à 21:08:49  profilanswer
 

n°1482635
dwogsi
Défaillance cérébrale...
Posté le 27-11-2006 à 22:00:00  profilanswer
 

onClick="randomdisplay();this.disabled='disabled'" Sur le bouton et puis le code est pas si bien fait qeu ça...
Edit : ayé corrigé au temps pour moi.


Message édité par dwogsi le 27-11-2006 à 23:07:18
n°1482710
gatsu35
Blablaté par Harko
Posté le 27-11-2006 à 23:03:32  profilanswer
 

disabled=disabled

n°1482758
gregm54
Posté le 28-11-2006 à 06:38:52  profilanswer
 

Merci pour vos réponses, moi j'ai trouvé : disabled=true ca marche donc je vais laisser comme ca! A la prochaine!


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  --- Desactiver un bouton ---

 

Sujets relatifs
[Résolu]Activer le code html sur un forum ? (et le desactiver ici lol)Desactiver un bouton
Désactiver le bouton "back" du navigateur[Access][VBA] Pbm tout bete, pouvoir désactiver un bouton sur clic...
bouton droit desactiver le menu[HTML/JS] Désactiver ou faire disparaître un bouton submit
Javascript : desactiver un bouton submit (le griser quoi)[HTML/JS] comment désactiver bouton close [X] ?
[FLASH] - désactiver/cacher un bouton[Javascript] comment désactiver un bouton?
Plus de sujets relatifs à : --- Desactiver un bouton ---


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR