<cfparam name="URL.IDList" default="">

function goNext()
{    // go to next page, with these options selected??
     var IDList = document.formname.checkboxname.value;
     document.location.href = "whatever.cfm?IDList=" & IDList;
}

function goPrev()
{    // show the previously selected items
     document.location.href = "whatever.cfm?IDList=" & <cfoutput>
#URL.IDList#</cfoutput>
}

<form name="formname" action="someother.cfm" method="POST">
     <cfif ListContains(URL.IDList, "1")>
          <input type="checkbox" value="1" name="checkboxname" checked>
1
     <cfelse>
          <input type="checkbox" value="1" name="checkboxname">   1
     </cfif>
     etc.

     <input type="Submit" name="Submit" value="Submit">
</form>

<a href="javascript:goNext()">Next</a>
<a href="javascript:goPrev()">Prev</a>


Not sure if that does what you're needing.


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                            
                    Dave Phipps                                                        
                            
                    <dave@phipps-        To:     <[EMAIL PROTECTED]>         
                            
                    cf.co.uk>            cc:                                           
                            
                                         Subject:     RE: [ cf-dev ] SOT: Checkboxes 
to list for next/previous     
                    10/15/02             functionality                                 
                            
                    12:36 PM                                                           
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



I don't think I was very clear in explaining what I am trying to do.  The
form submission only happens once the user is ready to submit it.  The
next/previous options are url links to the same page only showing the next
or previous set of 15 results.  If you have chosen any checkboxes on the
first page these are forgotten as soon as you go to the next or previous
set.  I want some way of storing the selected userid's using javascript so
that a url var is passed in the next/previous links which holds the userid
list which can then be added to or taken away from.

Once the form is submitted then the entire selected list can be passed in a

hidden field.

Any clearer???

Cheers

Dave ;)

At 13:12 10/15/2002 +0200, you wrote:
>This ought to do it:
>
>Create all the check boxes you want in the list with the same name, and
>set the values to the unique identifier for each user.
>
><cfoutput>
><cfif isDefined('form.userlist')>
>The following users were selected:<br>
>#form.userlist#
></cfif>
><form action="#cgi.script_name#" name="testform" method="post">
><input type="Checkbox" name="userlist" value="user1">
><input type="Checkbox" name="userlist" value="user2">
><input type="Checkbox" name="userlist" value="user3">
><input type="submit" value="test">
></form>
></cfoutput>
>
>Spike
>
>Stephen Milligan
>Team Macromedia - ColdFusion
>Co-author 'Reality Macromedia ColdFusion MX: Intranets and Content
>Management'
>http://spikefu.blogspot.com
>
> > -----Original Message-----
> > From: Dave Phipps [mailto:[EMAIL PROTECTED]]
> > Sent: 15 October 2002 13:06
> > To: ColdFusion User group
> > Subject: [ cf-dev ] SOT: Checkboxes to list for next/previous
> > functionality
> >
> >
> > Hi,
> >
> > I have a list of users each with a checkbox alongside holding the
> > userid.  I want to be able to take the selected checkboxes
> > and place the
> > values into a list which I can then pass in the url of the
> > next/previous
> > links.
> >
> > I basically want to be able to remember which checkboxes have
> > been selected
> > no matter how many times someone goes backwards and forwards.
> >  Once all the
> > required checkboxes have been chosen then I want this final
> > list to be
> > submitted as a hidden form field.
> >
> > I have looked at a load of javascript sites but can't find
> > quite the right
> > code.  Has anyone done this before or can give me a snippet
> > to get things
> > going?
> >
> > Sorry for the OT post.
> >
> > Cheers
> >
> > Dave
> >
> >
> > ============================================
> > Phipps CF Development
> > Oxford, Oxfordshire.
> > Telephone: +44(0)7718 896696
> > http://www.phipps-cf.co.uk
> > ============================================
> >
> >
> > --
> > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED] For human help, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
>
>--
>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>For human help, e-mail: [EMAIL PROTECTED]


============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to