piapia1 | je mets tout depuis le depart....
le but du jeu c'est remplir un formulaire qui se génère dans une autre fenêtre. Jusque là je n'utilisais que des case a coché et tout aller très bien. Mais j'ai voulu compliquer les choses, passer de la case a coché, a liste de choix. Et là cata plus rien de fonctionne.
voici le code:
Code :
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script language="JavaScript">
- var fois=0 //a supprimer si le r?sultat se fait dans un champ
- boutrep = new Array();
- function fradio1(bouton,reponse)
- {
- boutrep[bouton]=reponse
- }
- function fonct_form(form) {
- bgcolor='#ff9900'
- resultat='<html>\n<title>Résultat de la remontée</title>\n<head>\n<link rel="stylesheet" href="style.css" type="text/css" />\n</head>\n<body>\n';
- err ="";
- resultat +="<br>système d'exploitation :"+form.input1.value+".\n";
- resultat +="<br>type de connection : "+form.input2.value+".\n";
- if (form.input3.checked) {
- resultat +="<br>Mode routeur activé : Oui\n";
- }else resultat +="<br>Mode routeur activé : Non\n";
- if (form.input4.checked) {
- resultat +="<br>antivirus : désactivé\n";
- }else resultat +="<br>antivirus : activé\n";
- if (form.input5.checked) {
- resultat +="<br>firewall : désactivé\n";
- }else resultat +="<br>firwall : activé\n";
- resultat +="<br>Ipconfig :"+form.input6.value+".\n";
- if (form.input7.choix.selectedIndex==1) {
- resulta +="<br>Ipconfig /release + Ipconfig /renew : ok.\n";
- }
- if (form.input7.choix.selectedIndex==2) {
- resulta +="<br>Ipconfig /release + Ipconfig /renew : nok.\n";
- }
- if (form.input7.choix.selectedIndex==3) {
- resulta +="<br>Ipconfig /release + Ipconfig /renew : pas fait.\n";
- }
- if (form.input8.selectedIndex==1) {
- resulta +="<br>netsh winsock reset catalog : ok.\n";
- }
- if (form.input8.selectedIndex==2) {
- resulta +="<br>netsh winsock reset catalog : nok.\n";
- }
- if (form.input8.selectedIndex==3) {
- resulta +="<br>netsh winsock reset catalog : pas fait.\n";
- }
- if (form.input9.selectedIndex==1) {
- resulta +="<br>netsh int ip reset all : ok.\n";
- }
- if (form.input9.selectedIndex==2) {
- resulta +="<br>netsh int ip reset all : nok.\n";
- }
- if (form.input9.selectedIndex==3) {
- resulta +="<br>netsh int ip reset all : pas fait.\n";
- }
- if (err != "" ) {
- alert(err);
- }
- else{
- resultat +="</p>\n</body>\n</html>";
- if (fois == 1 ) result.close();
- result=open("","resultat","toolbar=no,bgcolor='#ffcccc', location=no, directories=no, status=no, menubar=no, scrollbars=1, resizable=1, top=200, left=400, width=500, height=500" );
- result.document.write(resultat)
- result.document.write('<p align="center" ><a href="javascript:window.close();">Fermer cette fenetre</a></p>')
- fois=1;
- }}
- </script>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>teste Basique</title>
- <link href="../style.css" rel="stylesheet" type="text/css" />
- </head>
- <body bgcolor="#FFFFFF">
- <div id="Haut"></div>
- <div id="Menu">
- <table align="center" border="0" cellpadding="0" cellspacing="0" width="558">
- <tbody>
- <tr>
- <td width="20"> </td>
- <td width="120"><a href="../testHL/PS.html" title="Perte de Synchro" class="Navigation">perte synchro </a></td>
- <td width="20"> </td>
- <td width="120"><a href="#" title="Probleme Nav" class="Navigation">probleme nav </a></td>
- <td width="20"> </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="Centre">
- <div align="center">
- <p align="center">Plus de nav ;-) </p>
- <div align="left">
- <form action="" method="post" name="monform" id="monform">
- <div align="left">
- <table height="653" border="0">
- <tbody>
- <tr bordercolor="#f3f3f3">
- <td width="391" height="26">système d'exploitation : </td>
- <td width="392" align="left" valign="middle"><select name="input1" id="input1">
- <option value="Windows XP Sp2">Windows XP Sp2</option>
- <option value="windows Xp">windows Xp</option>
- <option value="Windows Vista">Windows Vista</option>
- <option value="Windows 98">Windows 98</option>
- </select></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">type de connections : </td>
- <td valign="middle"><select name="input2" id="input2">
- <option value="USB">USB</option>
- <option value="Ethernet">Ethernet</option>
- <option value="WIFI">WIFI</option>
- </select></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">Mode Routeur </td>
- <td valign="middle"><label>
- <input name="input3" type="checkbox" id="input3" value="checkbox" />
- activé</label></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">antivirus</td>
- <td valign="middle"><label>
- <input name="input4" type="checkbox" id="input4" value="checkbox" />
- </label>
- Désactivé</td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">firewall</td>
- <td valign="middle"><label>
- <input name="input5" type="checkbox" id="input5" value="checkbox" />
- </label>
- Désactivé</td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26" >Ipconfig</td>
- <td bordercolor="#FFFFFF"><label>
- <input name="input6" type="text" id="input6" value="192.168.0.10" />
- </label></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">Ipconfig /release + ipconfig/renew </td>
- <td valign="middle"><label>
- <select name="input7" id="input7">
- <option value="ok">ok</option>
- <option value="nok">nok</option>
- <option value="pas fait">pas fait</option>
- </select>
- </label></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">netsh winsock reset catalog </td>
- <td valign="middle"><select name="input8" id="input8">
- <option value="ok">ok</option>
- <option value="nok">nok</option>
- <option value="pas fait">pas fait</option>
- </select></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26">netsh int ip reset all </td>
- <td valign="middle"><select name="input9" id="input9">
- <option value="ok">ok</option>
- <option value="nok">nok</option>
- <option value="pas fait">pas fait</option>
- </select></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26"> </td>
- <td valign="middle"><select name="input10" id="input10">
- <option value="ok">ok</option>
- <option value="nok">nok</option>
- <option value="pas fait">pas fait</option>
- </select></td>
- </tr>
- <tr bordercolor="#f3f3f3">
- <td height="26"> </td>
- <td valign="middle"><select name="input11" id="input11">
- <option value="ok">ok</option>
- <option value="nok">nok</option>
- <option value="pas fait">pas fait</option>
- </select></td>
- </tr>
- </tbody>
- </table>
- <br />
- <table border="0">
- <tbody>
- <tr>
- <td height="26" valign="middle" width="406"><div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
- <input onclick="fonct_dial(this.form)" value="Remise a zéro" name="button2" type="reset" />
- </font></div></td>
- <td valign="middle" width="144"><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
- <input onclick="fonct_form(this.form)" value="Valider" name="button1" type="button" />
- </font> </div></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="Pied_de_page">
- <h5 class="Style1" align="center">Copyright © 2007</h5>
- </div>
- </form>
- </div>
- </div>
- </div>
- </body>
- </html>
|
Message édité par piapia1 le 03-07-2007 à 21:14:06
|