5 Replies Latest reply on Nov 21, 2006 10:44 PM by MikerRoo

    Need help passing form variables

    Level 7
      My application has a search page and a results page, on the results page I
      used the "<previous - next>" DW server behaviors to split my results up to
      10 records per page. I have some form variables from my search page that
      pass to the initial results page, but when I click "next" for my next 10
      records, all the form variables are lost. So, my question is how can I pass
      these variables to the next pages??

      --
      Dusty


        • 1. Re: Need help passing form variables
          Charlie Griefer Level 1
          you can use hidden form fields (and a 'submit' button for 'next' instead of a text link...or have the text link trigger a JS function that would do a form submit()).

          you could put the variables into the session scope.

          if you absolutely had to (and hopefully there wouldn't be many), you could pass them in the URL (but for various reasons, i'd make that the ultimate 'no other option' plan).
          • 2. Re: Need help passing form variables
            Level 7
            Could you give me a code example? Say my search form has 3 variables: city,
            maximumprice, and minimumprice.

            at the top of my results page I have :

            <cfparam name="form.city" default=" ">
            <cfparam name="form.minimumprice" default=" ">
            <cfparam name="form.maximumprice" default=" ">

            and my link to the previous-next page:

            <a
            href="<cfoutput>#CurrentPage#?PageNum_wrmls=#Max(DecrementValue(PageNum_wrml
            s),1)##QueryString_wrmls#</cfoutput>">Previous</a> <a
            href="<cfoutput>#CurrentPage#?PageNum_wrmls=#Min(IncrementValue(PageNum_wrml
            s),TotalPages_wrmls)##QueryString_wrmls#</cfoutput>">Next</a>



            Thanks for the help!

            Dusty




            "[CJ]" <webforumsuser@macromedia.com> wrote in message
            news:ejva05$pd1$1@forums.macromedia.com...
            > you can use hidden form fields (and a 'submit' button for 'next' instead
            of a
            > text link...or have the text link trigger a JS function that would do a
            form
            > submit()).
            >
            > you could put the variables into the session scope.
            >
            > if you absolutely had to (and hopefully there wouldn't be many), you
            could
            > pass them in the URL (but for various reasons, i'd make that the ultimate
            'no
            > other option' plan).
            >


            • 3. Re: Need help passing form variables
              Level 7
              Anybody??

              --
              Dusty Carr
              IT Manager
              Coldwell Banker SSK
              dcarr@coldwellbankerssk.com
              478-953-8595


              "Dusty Carr" <dcarr@coldwellbankerssk.com> wrote in message
              news:ejvbkm$rbk$1@forums.macromedia.com...
              > Could you give me a code example? Say my search form has 3 variables:
              city,
              > maximumprice, and minimumprice.
              >
              > at the top of my results page I have :
              >
              > <cfparam name="form.city" default=" ">
              > <cfparam name="form.minimumprice" default=" ">
              > <cfparam name="form.maximumprice" default=" ">
              >
              > and my link to the previous-next page:
              >
              > <a
              >
              href="<cfoutput>#CurrentPage#?PageNum_wrmls=#Max(DecrementValue(PageNum_wrml
              > s),1)##QueryString_wrmls#</cfoutput>">Previous</a> <a
              >
              href="<cfoutput>#CurrentPage#?PageNum_wrmls=#Min(IncrementValue(PageNum_wrml
              > s),TotalPages_wrmls)##QueryString_wrmls#</cfoutput>">Next</a>
              >
              >
              >
              > Thanks for the help!
              >
              > Dusty
              >
              >
              >
              >
              > "[CJ]" <webforumsuser@macromedia.com> wrote in message
              > news:ejva05$pd1$1@forums.macromedia.com...
              > > you can use hidden form fields (and a 'submit' button for 'next' instead
              > of a
              > > text link...or have the text link trigger a JS function that would do a
              > form
              > > submit()).
              > >
              > > you could put the variables into the session scope.
              > >
              > > if you absolutely had to (and hopefully there wouldn't be many), you
              > could
              > > pass them in the URL (but for various reasons, i'd make that the
              ultimate
              > 'no
              > > other option' plan).
              > >
              >
              >


              • 4. Re: Need help passing form variables
                mdarchives
                I'd use session variables, setting them when you move to the first page.
                • 5. Re: Need help passing form variables
                  MikerRoo Level 1
                  The tutorial at http://tutorial39.easycfm.com/ should give you some ideas. Once you understand it, you'll know how to use session variables to preserve the form data.