#ListGetAt(temp, Counter)#
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => bigbrain28 [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> Complex Dynamic Form Calc? - Coldfusion - Advanced Techniques

Complex Dynamic Form Calc? - Coldfusion - Advanced Techniques

This question is so obscure I'm not sure how to pose it. I have a shopping cart site, apparel that comes in several sizes will dynamically create formfields for each size for quantity per size to be entered (IE style D456 has SM, L, XL, so the cart page has 3 fields to input how many of each size you want) Also on the page is the QUANTITY input box. OK... So I can pass the values of each to the cart, but I need to have the total for the "eaches" become the value for Quantity ( as in, ...

  1. #1

    Default Complex Dynamic Form Calc?

    This question is so obscure I'm not sure how to pose it.
    I have a shopping cart site, apparel that comes in several sizes will
    dynamically create formfields for each size for quantity per size to be entered
    (IE style D456 has SM, L, XL, so the cart page has 3 fields to input how many
    of each size you want) Also on the page is the QUANTITY input box. OK... So I
    can pass the values of each to the cart, but I need to have the total for the
    "eaches" become the value for Quantity ( as in, 2 small, 3 Large, 1 Xlarge
    shows in cart as info, but 6 (the sum) will evaluate the quantity.

    What I actually need help with is this:

    I query the DB to see what sizes are avail. This info is a csv list in 1
    field per record
    The list is currently feed into a loop to create input boxes, then that input
    data gets passes to the cart as "info" for the site owner to use to fill the
    order. I need to create a sum of the input values on the page before the form
    is submitted so it will evaluate the Quantity field with a total before the
    Session Cart values are set.
    I have found a JavaScript that will do the summing, but it must predefine the
    vars for the inputboxes, I need it to be dynamic. If there is a CF only way to
    accomplish this please, someone point me to it. I have the WACK book, but do
    not see this type of ssue covered...

    See current code below:


    <cfif getDetails.Size IS NOT "">
    <div align="right">Please tell us how many of each size you need:<br><br>
    <CFSET temp = ValueList(getDetails.Size)>
    <!--- loop through the list and show it with ListGetAt --->
    <CFLOOP From="1" To="#ListLen(temp)#" INDEX="Counter">
    <CFOUTPUT>
    #ListGetAt(temp, Counter)#<input name="textLines" type="textfield" value=""
    checked><br>
    </CFOUTPUT>
    </CFLOOP>
    <cfelse>
    <input name="textColor" type="HIDDEN" value="No Color">
    </cfif>

    bigbrain28 Guest

  2. #2

    Default Re: Complex Dynamic Form Calc?

    Are you only going to have one item per page? For instance, one shirt with the
    inputs for the quantity and sizes. Or, are there multiple items with multiple
    quantities and sizes?

    If there is only one, you can use javascript with a global total variable and
    an onchange on each quantity input to update the total variable by passing
    this.value, or something similiar. The call to the update total function can
    also adjust your total fields' values.

    travelinrob Guest

Similar Threads

  1. Dynamic WHERE (more complex)
    By raulriera in forum Coldfusion Database Access
    Replies: 7
    Last Post: January 10th, 11:33 PM
  2. Submit a form - Complex!
    By Ricky S in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: July 4th, 08:03 PM
  3. Creating a Dynamic form
    By jefreywith1f in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 15th, 03:57 PM
  4. Adding/Updating records on form with complex query
    By Steve Marsden in forum Microsoft Access
    Replies: 0
    Last Post: July 28th, 10:07 AM
  5. Sum Calc Field In Form Footer
    By Steve Schapel in forum Microsoft Access
    Replies: 3
    Last Post: July 27th, 06:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •