accéder à checkBox et listes déroulantes
Salut tout l'monde!
Ben voila je débute en VBScript et je dois faire une boîte de message toute "bidon" qui prend en compte les zones de saisie du formulaire :
Voici mon code (qui ne marche pas et ça fait depuis 2 ou 3 heures que je planche dessus et il n'y a rien à faire!)
Donc voila est ce que quelqu'un pourrait m'expliquer le pourquoi du comment , ce serait vraiment sympa
Merci d'avances
Nico
PS: Le code ^^ :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
<html>
<head>
<script language = "vbscript">
Function frmSaisie_onSubmit()
Dim strBoursierOuNon
Dim strQualité
If Document.frmSaisie.chkBoursier.Checked = True Then
strBoursierOuNon = "boursier"
else
strBoursierOuNon = "non boursier"
End if
Select Case Document.frmSaisie.optQualite.Value
Case 1
strQualite = "externe"
Case 2
strQualite = "demi-pensionnaire"
Case Else
strQualite = "interne"
End Select
If Document.frmSaisie.txtNom.Value = "" Or _
Document.frmSaisie.txtPrenom.Value = "" Or _
Document.frmSaisie.txtMDP.Value = "" Then
MsgBox "Vous n'avez pas renseigné tous les champs obligatoires"
Else
MsgBox "Vous vous appelez " & Document.frmSaisie.txtPrenom.Value & " " & _
Document.frmSaisie.txtNom.Value & vbCrLf & "Vous êtes " & _
strQualite & " et " & strBoursierOuNon & vbCrLf & _
"Vous avez un bac " & Document.frmSaisie.lstSerieBac.Text
End If
End Function
</script>
</head>
<body>
<form name = "frmSaisie">
<fieldset>
<legend> IDENTITÉ </legend> <br />
<label> <u>N</u>om : </label>
<input type = "text" name = "txtNom"
accesskey = "N" tabindex = "10" >
                 
<label> <u>P</u>rénom : </legend>
<input type = "text" name = "txtPrenom"
accesskey = "P" tabindex = "20" > <br />
<br />
<label> <u>M</u>ot de passe : </label>
<input type = "text" name = "txtMDP"
accesskey = "M" tabindex = "30" >
</fieldset> <br />
<fieldset>
<legend> SCOLARITÉ </legend>
<br />
<table>
<tr><td>
<label> Qualité </label>
</td> <!--finit travaillé ds col --> <td>
<u>E</u>xterne <input type = "radio" name = "optQualite"
value = "1" checked = "checked" accesskey = "E" tabindex = "40" >
</td></tr> <tr><td> </td><td>
<u>D</u>emi-pensionnaire <input type = "radio" name = "optQualite"
value = "2" accesskey = "D" tabindex = "50" >
</td></tr> <tr><td> </td><td>
<u>I</u>nterne <input type = "radio" name = "optQualite"
value = "3" accesskey = "I" tabindex = "60" > <br />
</td></tr>
</table>
<br />
<label> <u>B</u>oursier </label>
<input type = "checkbox" name = "chkBoursier"
accesskey = "B" tabindex = "70" > <br />
<br />
<label> Série Bac </label>
<select name = "lstSerieBac" tabindex = "80">
<option value = "IG" > STT IG </option>
<option value = "CG" > STT CG </option>
<option value = "S" > S </option>
<option value = "ES" > ES </option>
</select> <br />
<br />
<label> Observations </label> <br />
<textarea name = "txtObservtions" rows = "5"
cols = "50" tabindex = "90"></textarea> <!-- coller balises pour avoir curseur au début -->
</fieldset> <br />
<center>
<input type = "submit" value = "Valider">
<input type = "reset" value = "Annuler">
</center>
</form>
</body>
</html> |