<!--
Auteur : bbil
Date : 18/03/2009
site : http://bbil.developpez.com/tutoriel/vbs/interface-hta/
Fonction : contr?les
-->
<head>
<title>Les Contr?les</title>
<HTA:APPLICATION
APPLICATION="htaControles"
>
</head>
<script language="VBScript">
Sub Window_Onload
'Liste box dynamique:
CreerLstDyn
end sub
Sub CreerLstDyn
For i = 1 to 10
Set oOption = Document.createElement("OPTION")
oOption.Text = "Opt" & i
oOption.Value = "Option " & i
lstDyn.Add(oOption)
next
end sub
Sub affichNom
Dim stCouleur
Dim i
for i = 0 to optCouleur.length -1
if optCouleur(i).Checked then
stCouleur = optCouleur(i).value
exit for
end if
next
Dim stTransport
For i = 0 to chkTransport.length - 1
if chkTransport(i).checked then
stTransport = stTransport & chkTransport(i).value & ", "
end if
next
Dim stSport
For i = 0 to lstSports.length - 1
if lstSports(i).Selected then
stSport = stSport & lstSports(i).value & " "
end if
next
MsgBox "Votre Nom est : " & txtNom.value & vbCrlf & _
"Mot de passe : " & txtMotDePasse.value & vbCrlf & _
"Couleur : " & stCouleur & vbCrlf & _
"Moyens de transport : " & stTransport & vbCrlf & _
"Sports pratiqu?s : " & stSport,vbExclamation,"interface-hta"
Msgbox txtCommentaires.Value ,vbEclamation,"Vos commentaires"
End Sub
Sub ChoixChaine
msgBox lstChaines.Value
end sub
Sub ChoixFichier
msgbox inFichier.value
end sub
</script>
<body>
Saisir votre nom : <INPUT TYPE="text" NAME="txtNom" SIZE="20" MAXLENGTH="30" VALUE="bbil"><BR>
Mot de passe : <INPUT TYPE="password" NAME="txtMotDePasse" TITLE="Saisir votre mot de passe" SIZE="20" MAXLENGTH="30" VALUE=""><BR>
<BR>
Votre couleur pr?f?r?e : <BR>
<INPUT TYPE="radio" NAME="optCouleur" VALUE="Bleu" CHECKED>Bleu<BR>
<INPUT TYPE="radio" NAME="optCouleur" VALUE="Rouge">Rouge<BR>
<INPUT TYPE="radio" NAME="optCouleur" VALUE="Vert">Vert<BR>
<BR>
Vos moyens de transport pr?f?r?s ? : <BR>
<INPUT TYPE="checkbox" NAME="chkTransport" VALUE="V?lo" CHECKED>V?lo<BR>
<INPUT TYPE="checkbox" NAME="chkTransport" VALUE="Voiture"CHECKED>Voiture<BR>
<INPUT TYPE="checkbox" NAME="chkTransport" VALUE="Marche">Marche ? pied<BR>
<INPUT TYPE="checkbox" NAME="chkTransport" VALUE="train" >Train<BR>
<INPUT TYPE="checkbox" NAME="chkTransport" VALUE="bus">Bus
<BR><BR>
<SELECT NAME="lstChaines" SIZE=4 onChange="ChoixChaine">
<OPTION VALUE="TF1">TF1
<OPTION VALUE="FR2">France 2
<OPTION VALUE="FR3" SELECTED>France 3
<OPTION VALUE="C+" >CANAL PLUS
</SELECT>
<BR>
SIZE=4
<BR><BR>
Sports pratiqu?s : <BR>
<SELECT NAME="lstSports" SIZE=4 MULTIPLE>
<OPTION VALUE="rugby">rugby
<OPTION VALUE="foot">foot
<OPTION VALUE="basket-ball" SELECTED>Basket
<OPTION VALUE="hand-ball" >Hand
</SELECT>
<BR><BR>
Liste dynamique : <BR>
<SELECT NAME="lstDyn">
</SELECT>
<BR><BR>
Vos commentaires <BR>
<TEXTAREA NAME="txtCommentaires" ROWS="3" COLS="40" >
</TEXTAREA>
<BR><BR>
<input type="button" value="Aff" onClick="affichNom">
<BR><BR>
<INPUT TYPE="file" NAME="inFichier" SIZE="30" onChange="choixfichier">
<input type="button" value="Validez Fichier" onClick="choixfichier">
</body>