Bonjour tt le monde,
voilà mon souci ce que je n'arrive pas à afficher mes informations saisi dans la fonction alert() (en une seule fois) et idem pour les informations manquantes , puis recuperer les libelées de chaque champs et de la liste de selection
merci d'avance de votre aide.
<
html
xmlns
="
http://www.w3.org/1999/xhtml "
><
head
>
<
title
>
Page sans titre
</
title
>
<
style
>
</
style
></
head
><
body
><
form
>
<
table
>
<
tr
>
<
td
>
Nom:
</
td
><
td
><
input
type
="text"
name
="txtNom"
maxlength
="18"
size
="18"
/></
td
>
</
tr
>
<
tr
>
<
td
>
Pr‚nom:
</
td
><
td
><
input
type
="text"
name
="txtPrenom"
maxlength
="18"
size
="18"
/></
td
>
</
tr
>
<
tr
>
<
td
>
Date de naissance:
</
td
><
td
><
input
type
="text"
name
=txtDateNaissance
maxlength
="18"
size
="18"
/></
td
>
</
tr
>
<
tr
>
<
td
>
S‚lectionner votre m‚tier
</
td
>
<
td
>
<
select
name
="optMetier">
<
option
value
="01">
biologiste
</
option
>
<
option
value
="02">
pilote
</
option
>
<
option
value
="03">
informaticien
</
option
>
<
option
value
="04">
mecanicien
</
option
>
<
option
value
="05">
astronaute
</
option
>
<
option
value
="06">
medecin
</
option
>
<
option
value
="07">
professeur
</
option
>
</
select
>
</
td
>
</
tr
>
<
tr
>
<
td
style
="vertical-align: top">
S‚lectionner votre couleur pr‚f‚r‚:
</
td
>
<
td
>
<
select
name
="lstColor"
size
=5>
</
select
>
</
td
>
</
tr
>
</
table
>
<
input
type
="button"
id
="poButtonAfficher"
value
="Envoyer"
/>
</
form
>
</
body
></
html
>
<
script
language
="javascript"
>
//document.forms[0].poButtonRemplir.onclick = pvRemplir;
window.onload = pvRemplir;
document.forms[0].poButtonAfficher.onclick = pvControleSaisie;
function
pvRemplir(){
var
ioOption;
var
isValeur;
var
iiIndex;iaTableauValeur =
new
Array(
"bleu"
,
"rouge"
,
"jaune"
,
"vert"
);
for
(iiIndex=0; iiIndex < iaTableauValeur.length; iiIndex++){
isValeur = iaTableauValeur[iiIndex];
ioOption =
new
Option(isValeur);
document.forms[0].lstColor.add(ioOption);
}
}
function
pvControleSaisie() {
for
(iiIndex=0; iiIndex < document.forms[0].length; iiIndex++){
isValeur = document.forms[0].elements[iiIndex].value;
isName = document.forms[0].elements[iiIndex].name;
//isLibelle = document.forms[0].elements[iiIndex -2].innerHTML;
if
(isValeur ==
""
){
isMessage =
"veuillez remplir votre "
+ isName +
"\n"
;document.forms[0].elements[iiIndex].focus();
alert(isMessage);
return
false
;}
{
}
}
}
Afficher la suite