The JS solution he's looking for isn't all that complicated
actually....
<input type="hidden" name="allchecked" value="#cfvalue#" />
<input type="checkbox" onclick="gochecked(this);" />
<script language="javascript">
function gochecked(fld) {
var x = 0;
var allchk = fld.form.allchecked.value.split(",");
if (fld.checked==true) {
allchk[allchk.length] = fld.value;
}
else {
for (x = 0; x < allchk.length; x++) {
if (allchk[x]==fld.value) { allchk[x] = ""; break; }
}
}
fld.form.allchecked.value = "";
for (x = 0; x < allchk.length; x++) {
fld.form.allchecked.value += allchk[x] + ",";
}
}
function goNext() { document.location.href = yadda yadda +
document.forms.myform.allchecked.value; }
</script>
<a href="javascript:goNext();">next</a>
hth
Isaac
Original Message -----------------------
Why dont you use WDDX,
when a check box is checked add it to an array with a string index not an
int index,
only because its easier to delete if the checkbox is unchecked,
then when they click next page serialise the js array and pass the wddx
along the url,
or do a form post on your next button links that passes the wddx packet
inside a hidden field.
Then update your sesion var server end before displaying your data.
Alernatively why not use a cookie and use javascript to to append ids and
remove ids.
You have a max of 4k of data with a cookie.
J
-----Original Message-----
From: chad [mailto:[EMAIL PROTECTED]
Sent: 12 August 2003 15:05
To: CF-Talk
Subject: ColdFusion and Javascript
I need some help with integrating coldfusion and JavaScript. I am building a
comparison application that will allow customers to select products to
compare. I have a checkbox under each product that I need (when selected) to
add that productID to a coldfusion array (which is a session variable). The
reason why I am going with JavaScript is because I am showing 25 products
per page, so when a user clicks on "Next Page" they don't loose the
previously checked products. The "Next Page" is not within a form tag, so I
can't just pass the checkbox variable.
Any help would be great.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4