jokerparis
Programmer
i have create a form like this :<br><br><cfoutput><br><cfform action="ajout.cfm?val=#Nb_Sonda#" method="POST"><br><CFLOOP CONDITION="i LESS THAN OR EQUAL TO Nb_Sonda"><br>Saisissez la réponse numéro #i# :<br><br><input type="text" ID= ToString("champ" & #i#)><br><br><CFSET i=i + 1> <br></cfloop><br><br><br><input type="Submit" value="Validez Sondage"><br></cfform><br></cfoutput><br><br>where nb_sonda is a value passed by a precedent form, to create dynamic fields<br><br>next i want to store that in database :<br><br><cfquery name="num" datasource="essai"><br>select max(Id_Sonda) as NumSonda<br>from sondage<br></cfquery><br><br><cfset j = '1'><br><cfoutput><br><CFLOOP CONDITION="j LESS THAN OR EQUAL TO Val"> <br><cfset envoi = document.forms(tostring("champ" & #j#))><br><cfquery name="rep_sond" datasource="essai"><br>insert into question_sondage(Id_Sonda , Lib_Quest_Sonda , Compt_Quest_Sonda)<br>values ('#num.NumSonda#' , '#envoi#' , '0')<br></cfquery><br><CFSET j=j + 1> <br></cfloop><br></cfoutput><br><br><br>I don't arrive to use the value of the fields in the other forms.