how about something like this...

If you had four form buttons called fist, prev, next, and last....


<CFQUERY name="GetRecord" dataSource="your_db" maxRows=1>

 SELECT
      questions_id as IDfield
 FROM
      tbl_questions
 WHERE
  survey_id = <cfqueryparam value="#survey_id#"
      cfsqltype="CF_SQL_NUMERIC">

 <CFIF isdefined("Form.btn_first.x")>
  AND questions_id  <  <cfqueryparam value="#questions_id#"
          cfsqltype="CF_SQL_NUMERIC">
  ORDER BY
   test_questions_id
 <CFELSEIF isdefined("Form.btn_prev.x")>
  AND questions_id  < <cfqueryparam value="#questions_id#"
         cfsqltype="CF_SQL_NUMERIC">
  ORDER BY
   test_questions_id DESC
 <CFELSEIF isdefined("Form.btn_next.x")>
  AND questions_id  > <cfqueryparam value="#questions_id#"
         cfsqltype="CF_SQL_NUMERIC">
  ORDER BY
   test_questions_id
 <CFELSEIF isdefined("Form.btn_last.x")>
  AND questions_id > <cfqueryparam value="#questions_id#"
          cfsqltype="CF_SQL_NUMERIC">
  ORDER BY
   questions_id DESC
 </CFIF>
</CFQUERY>


----- Original Message ----- 
From: "Knott, Brian" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 26, 2003 3:29 PM
Subject: [cfaussie] RE: Self submitting form problem


> You could have the next question number as a hidden field in the form.
When
> its submitted use the question number to get the correct question.  If it
> form.question is blank then the questions finished.
>
> Brian Knott
>
> -----Original Message-----
> From: Jake A [mailto:[EMAIL PROTECTED]
> Sent: Friday, 26 September 2003 3:16 PM
> To: CFAussie Mailing List
> Subject: [cfaussie] Self submitting form problem
>
>
> Hi all,
>
> I have a survey which requires one question per page. The form is database
> driven and depending on how many questions there is in the database, this
> will determine how many pages need to be created. The question i have is
> how do you get the self-submiting form to increment and show the next
> question each time the user answers the question and hit the submit
> button? Any suggestions!
>
> Thanks
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to