voila c bourrin mais t as tt ce qu il te faut:
<!-- #include file="./common/conn.asp" -->
<%
'If Session("id" ) = "" AND Session("nom" ) = "" Then Response.Redirect "main.asp"
'If NOT session("admin" ) and NOT session("president" ) Then response.redirect "main.asp"
logged = 0
If Session("id" ) <> "" AND Session("mail" ) <> "" Then logged = 1
SortBy = "sondages.ID_sondage"
If Request.QueryString("tri" ) <> "" Then SortBy = Request.QueryString("tri" )
StrSQL = "SELECT sondages.Question, sondages.ID_Sondage, DateUp, Online, nbreponse FROM Sondages, Repondre, Reponses WHERE sondages.ID_sondage = repondre.ID_sondage AND repondre.ID_reponse = reponses.ID_reponse ORDER BY "& SortBy
Set rsSondage = Server.CreateObject("ADODB.RecordSet" )
rsSondage.CursorLocation = 3
rsSondage.open StrSQL, conn, 3, 3
'--------------- Gestion de la page ------------------------
If Request.QueryString("iPage" ) <> "" Then
Page = Request.QueryString("iPage" )
Else
Page = 1
End If
If Request.QueryString("NumPageMini" ) = "" then
NumPageMini = Int(1)
Else
NumPageMini = CInt(Request.QueryString("NumPageMini" ))
End If
'-----------------------------------------------------------
If Not rsSondage.EOF Then
rsSondage.PageSize = 4
rsSondage.AbsolutePage = Page
NbPagesTotal = rsSondage.PageCount
End If
i = Request.Form("i" )
If i = "" Then i= 3
%>
<html>
<head>
<title>Add Sondage</title>
<link rel="stylesheet" href="common/wmun.css" type="text/css">
<script language='javascript'>
<!--
<%
If Request.QueryString ("msg" ) = "added" Then Response.Write "alert('successfully added');"
If Request.QueryString ("msg" ) = "modified" Then Response.Write "alert('successfully modified');"
%>
function test_sond()
{
var str_err = "Informations incorrectes : \n";
if(document.sond.question.value == "" )
str_err += " - Question\n";
<%
j = 1
While j < CInt(i)
%>
if (document.sond.reponse<%= j%>.value == "" )
str_err += " - Champ Reponse numéro <%= j%>\n";
<%
j = j + 1
Wend
%>
if (str_err != "Informations incorrectes : \n" )
alert(str_err);
else
{
document.sond.action = "add_sondage_finish.asp";
document.sond.submit();
}
}
//-->
</script>
</head>
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="745" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="115">
<table width="745" height="120" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="120"><img src="./logo/BAN_MUM3.jpg" border="0"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="745">
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="140" bgcolor="#F5F5F5">
<br><br>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#F5F5F5" name="menuleft">
<tr>
<td height="100%" width="100%" valign="top" align="left">
<br>
<!-- #include file="./menu_logged.asp" -->
</td>
</tr>
</table>
</td>
<td width="613" valign="top" align="center">
<br><br><br>
<table width="98%" cellpadding="5" cellspacing="0" border="0" align="center">
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="maintitle" valign="bottom">SONDAGES</td>
</tr>
<tr>
<td class="maintitle" valign="top"><hr size="2" color="#575757" width="100%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="maincontent">Nouveau Sondage</td>
</tr>
</table>
<form name="sond" action="add_sondage_finish.asp" method="post">
<input type="hidden" name="i" value="<%= i%>">
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td class="maincontent"><b>Question </b></td>
<td><input type="text" name="question" value="<%= Request.Form("Question" )%>" size="50"></td>
</tr>
<tr><td><br><br></td></tr>
<tr>
<td class="maincontent" colspan="2"><b>Réponses</b></td>
</tr>
<tr>
<td colspan="2" align="right">
<table align="right" border="0" cellpadding="0">
<tr>
<td><input type="button" name="add" value=" Ajouter une réponse " OnClick="document.sond.i.value =Number(document.sond.i.value) + 1;document.sond.action='add_sondage.asp?action=add';document.sond.submit();"></td>
<td><input type="button" name="rem" value="Supprimer une réponse" OnClick="if ((Number(document.sond.i.value) - 1) <= 2){ alert('Suppression impossible, deux champs réponse minimum'); return false;}document.sond.i.value =Number(document.sond.i.value) - 1;document.sond.action='add_sondage.asp?action=rem';document.sond.submit();"></td>
</tr>
</table>
</td>
</tr>
<%
j = 1
While j < CInt(i)
val = ""
If Request.Form ("reponse"&j) <> "" Then val = Request.Form ("reponse"&j)
%>
<tr>
<td align="right" class="simple"><%= j%></td>
<td><input type="text" name="reponse<%= j%>" value="<%= val%>" size="50"></td>
</tr>
<%
j = j + 1
Wend
%>
<tr>
<td colspan="2" align="right"><input type="button" name="alright" value="Valider" OnClick="test_sond();"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language=JavaScript src="./menu_array.js" type=text/javascript></script>
<script language=JavaScript src="./mmenu.js" type=text/javascript></script>
</body>
</html>
<!-- #include file="./common/end_conn.asp" -->