Comment valider un formulaire +sieurs radio
ronin03
Messages postés
10
Statut
Membre
-
flokocha Messages postés 1519 Statut Membre -
flokocha Messages postés 1519 Statut Membre -
Bonjour,
Je voudrais savoir pkoi mon programme ne marche pas.
Voici mon code javaScript:
function Btcocher(Formulaire,$taille) {
OK=false;
alert("diouf");
for(i=0;i<taille;i++) {
if( formulaire.question[i].checked)
OK=true;
}
if (!OK) {
alert("Vous devez choisir une question.");
event.returnValue=false;
}
}
Voici mon code php :
<FORM ACTION="afficheExam.php" MEHTOD="POST" NAME="recaputilatif" onSubmit = "Btcocher(this,$taille);">
<TABLE BORDER="1%" WIDTH="90%">
<TR>
<TD WIDTH="50%" BGCOLOR="#9999FF" ALIGN="center">
<B><FONT SIZE="4">Thème:
<?
print($id_theme);
?>
</FONT></B>
</TD>
</TR>
<TR>
<TD WIDTH="500%" BGCOLOR="#9999FF" ALIGN="center"><B><FONT SIZE="4">Question associées:</FONT></B></TD>
</TR>
</TABLE>
<TABLE BORDER="0%" WIDTH="90%">
<TR>
<?
$nb = 1;
while($ligne = mysql_fetch_object($result))
{
$nom = htmlentities($ligne->nom);
$num_ufr = $ligne->num_ufr;
print("<TR>
<TD WIDTH=\"44%\" ALIGN=\"center\"><B><FONT SIZE=\"3\">$ligne->intitule</FONT></B></TD>
<TD WIDTH=\"20%\" ALIGN=\"center\">
<INPUT TYPE=\"radio\" NAME =\" question\">
</TD>
</TR>");
$nb ++;
}
?>
</TR>
</TABLE
Merci.
Je voudrais savoir pkoi mon programme ne marche pas.
Voici mon code javaScript:
function Btcocher(Formulaire,$taille) {
OK=false;
alert("diouf");
for(i=0;i<taille;i++) {
if( formulaire.question[i].checked)
OK=true;
}
if (!OK) {
alert("Vous devez choisir une question.");
event.returnValue=false;
}
}
Voici mon code php :
<FORM ACTION="afficheExam.php" MEHTOD="POST" NAME="recaputilatif" onSubmit = "Btcocher(this,$taille);">
<TABLE BORDER="1%" WIDTH="90%">
<TR>
<TD WIDTH="50%" BGCOLOR="#9999FF" ALIGN="center">
<B><FONT SIZE="4">Thème:
<?
print($id_theme);
?>
</FONT></B>
</TD>
</TR>
<TR>
<TD WIDTH="500%" BGCOLOR="#9999FF" ALIGN="center"><B><FONT SIZE="4">Question associées:</FONT></B></TD>
</TR>
</TABLE>
<TABLE BORDER="0%" WIDTH="90%">
<TR>
<?
$nb = 1;
while($ligne = mysql_fetch_object($result))
{
$nom = htmlentities($ligne->nom);
$num_ufr = $ligne->num_ufr;
print("<TR>
<TD WIDTH=\"44%\" ALIGN=\"center\"><B><FONT SIZE=\"3\">$ligne->intitule</FONT></B></TD>
<TD WIDTH=\"20%\" ALIGN=\"center\">
<INPUT TYPE=\"radio\" NAME =\" question\">
</TD>
</TR>");
$nb ++;
}
?>
</TR>
</TABLE
Merci.
A voir également:
- Comment valider un formulaire +sieurs radio
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Radio française - Télécharger - Médias et Actualité
- Formulaire de reclamation instagram - Guide
- Formulaire de contact le bon coin introuvable - Forum Réseaux sociaux