chad:

I think what's confusing you, in spite of the responses you've gotten, is
that you have to understand the logistics of both CF and JavaScript.

CF is a server side entity.  Once the page has reached the client's browser,
CF is done and out of the picture until the next trip to the server (whether
it be a page refresh or a click of a link).

JS is entirely on the client.  JS variables do not travel to the server.
They do not persist beyond one single page view (with the exception of
cookies, of course).

With that understanding, there is no way to add js variables to a cf session
without refreshing the page.

If you place your JS variables in form fields (hidden or otherwise), they
*will* be passed to the server, in which case you can manipulate them as
regular form field values with CF.

Hope that helps some.

Charlie

----- Original Message ----- 
From: "chad" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, August 12, 2003 9:29 AM
Subject: Re: RE: ColdFusion and Javascript


> Is there a way in the javascript to output the entries into the javascript
> array into a CF session array?
> ----- Original Message ----- 
> From: "s. isaac dealey" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, August 12, 2003 12:25 PM
> Subject: RE: RE: ColdFusion and Javascript
>
>
> > 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

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to