Well, I figured it out. Thank you for all the replys. What i needed to
do is add a hidden field to the form and then just manipulate the
information passed through that. I'm making a shopping cart. I was
trying to dynamically update the qty value if a user clicked +/-. I
was having a hard time trying to find out how to +/- the qty's while
at the same time updateing the totals. a few lines of code did the
trick...
<cfif IsDefined("form.add_to_qty")>
<cfset session.cart[#prodID#].quantity=session.cart[#form.prodID#].quantity+1>
<cfelseif IsDefined("form.take_away_from_qty")>
<cfset session.cart[#prodID#].quantity=session.cart[#form.prodID#].quantity-1>
</cfif>
Actually, cfset session.cart[#prodID#] was a typo. I was going to put
form.prodID but when i did that earlier it was +/- 2 instead of one
because i was inside a loop.
I'm not sure if any of this makes sense but that was my solution.
Thanks again for the help. It really helped when it was pointed out
that only 1 form gets processed.
Phil
On Tue, Mar 11, 2008 at 6:43 PM, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> Yes, the same people I have seen do it also only allow the form to be
> submitted via JS. I have even seen where they only allow it to be submitted
> from JS then they populate a hidden form value with a label, which again
> seems flawed because then in the processing code they check for specific
> labels. Change the label and the processing code fails to run as expected.
>
> On Tue, Mar 11, 2008 at 3:33 PM, Dominic Watson <
> [EMAIL PROTECTED]> wrote:
>
> > >
>
> > > I have seen some people just do it off the value of the Submit button.
> > > Although kind of sucks when they change the value in the button but
> > forget
> > > to change their switch/case or if/else on the processing end of things.
> >
> >
> > You can do that, but if your user hits return to submit the form, the
> > submit
> > button name will not be posted. While you can't hit return to submit all
> > forms, I think it preferable to use one technique throughout your code.
> >
> > Here is a demo template, run it by hitting the submit button and then
> > again by hitting return after entering some text (if it works, try it in
> > another browswer, I think this is a broswer issue).
> >
> > <cfif StructKeyExists(form,"myButton")>
> > <h1>Hello world</h1>
> > </cfif>
> >
> > <form action="" method="post">
> > <input name="foo" value="bar"/>
> > <input type="submit" value="Go go gadget legs" name="myButton" />
> > </form>
> >
> > The code will do what you expect in Firefox but not in IE.
> >
> > Dom
> >
> > --
> > Blog it up: http://fusion.dominicwatson.co.uk
> >
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301033
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4