- see footer for list info -<
Can't you just order the query by form postition so that the elements
you want in the form are already ordered how you need them regardless
of whether you change the values of the order on the table?
The loop should always then output the form elements how they are set
up on the table!?
On 10/5/06, Paul Swingewood <[EMAIL PROTECTED]> wrote:
>- see footer for list info -<
Hello all.
I have some code which reads the description of a form element (in this case
a check box) from the database and then displays them on the screen using a
loop to show a table 3 cells wide and however many rows dependant on the
number of records. Quite easy really.....
Now I want to be able to position any form description anywhere on the
matrix dependant on its formPosition number.
So,
BullyingTypeIDPK BullyingType FormPosition
1 Racist 1
2 Homophobic 2
3 Disabilist 3
4 Religiously Motivated 4
5 Cyber 5
6 Other 6
If I change the form position numbers the form element will change position
on the form ...
At present I have
<!--- Get the Bullying Types --->
<cfquery name="GetBullyingType"
datasource="#Application.RacistDSN#">
SELECT DISTINCT
tblBullyingTypes.BullyingTypeIDPK,
tblBullyingTypes.BullyingType,
tblBullyingTypes.FormPosition
FROM tblBullyingTypes
</cfquery>
<cfform name="IncidentForm" action="WriteData.cfm"
method="post">
<input type="hidden" name="FormNumber"
value="1">
<!--- Display the Bullying Types --->
<table border="0" width=100% cellpadding="3"
class="itemTable">
<tr>
<td colspan="3" valign="top" align="left"
bgcolor="#cceaff">
<b>Is this bullying:</b>
<i>Select all that apply</i>
</td>
</tr>
<tr>
<cfset count_var=0>
<cfoutput
query="GetBullyingType">
<td valign="top" align="left"
bgcolor="##cceaff">
<cfinput type="checkbox"
name="BullyingType"
value="#BullyingTypeIDPK#">
#BullyingType#
</td>
<cfset count_var =
count_var + 1>
<cfif count_var eq 3>
<cfset
count_var=0>
</tr>
<tr>
</cfif>
</cfoutput>
</tr>
</table>
</cfform>
I need to modify this loop somehow to take account into what the form
position is.
I can't get my head into gear on this one. Can anyone help please ....?
You can see the output here http://www.bgfl.org/cfpages/bullying/test.cfm
Regards - Paul
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
--
Rich
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<