Epractical Posted November 2, 2005 Share Posted November 2, 2005 Bonjour, Je souhaiterai désactiver une série de boutons radios lors d'un clique sur un bouton, j'ai eu beau chercher je ne trouve pas, quelqu'un pourrait m'aider ? Merci d'avance, cordi@lement William T-J Link to comment Share on other sites More sharing options...
Sentinel Posted November 3, 2005 Share Posted November 3, 2005 Pour cela il faut ruser un peu, avec du javascript. Je t'ai écrit un exemple complet : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Test de onChange</title> <script language="javascript"> function desactiverRadios(radiosName) { var mesRadios = document.getElementsByName(radiosName); for (i=0; i<mesRadios.length; i++) { mesRadios[i].disabled=true; } } </script> </head> <body> <form name="myform"> <input type="radio" name="myradio" value="radio1" checked="checked"/>radio1<br/> <input type="radio" name="myradio" value="radio2" />radio2<br/> <input type="radio" name="myradio" value="radio3" />radio3<br/> <input type="button" value="Désactiver" onClick="javascript:desactiverRadios('myradio');"/> </form> </body> </html> Link to comment Share on other sites More sharing options...
Epractical Posted November 3, 2005 Author Share Posted November 3, 2005 Woua super ça marche !!!! Merci beaucoup, j'ai une dernière petite question comment fait toujours en javascript, pour executer une fonction après un délais ? Merci d'avance cordi@lement William T-J Link to comment Share on other sites More sharing options...
Epractical Posted November 5, 2005 Author Share Posted November 5, 2005 Bonjour, Quelqu'un pourrait m'aider s'il vous plait ? J'ai trouvé la fonction : setTimeout(); mais j'ai eu des petits problèmes sur la syntaxe : setTimeout("fonction_test(),5000); ne marche Merci d'avance Très cordi@lement William T-J Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.