CF linking with variables

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default CF linking with variables

    I want to give some background information first:

    I am making an online book selling/trading for a small group of people. They
    can request a book or sell a book. On the form where they add their information
    (addbook.cfm), I want it to only display certain fields depending on what they
    want to do. So if they wish to sell a book, I do not want the book requesting
    field to be viewable.

    I have an index.cfm page that will send them to addbook.cfm, but I want to
    have two links: "Selling a Book" and "Requesting a Book". Depending on which
    they click, they will only see the fields pertaining to their choice.

    On addbook.cfm I have <cfparam name=decidebk default="sell"> where decidebk is
    my variable that holds the information. around the table rows I have
    <cfif decidebk is "buy"> (table row with this field) <cfelse> (table rows with
    selling information) </cfif>

    I was thinking that on the index page I would have
    <a href="addbook.cfm?ID=#decidebk#">Sell a Book</a>
    I dont think this is right, though, because I'm not sure how to tell it to
    show the information for "Requesting a Book".

    I know this is extremely long and probably very confusing but I have tried so
    much to no avail. Anything will help!!

    standal Guest

  2. Similar Questions and Discussions

    1. #39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
      From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug...
    2. #39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
      From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug...
    3. Linking with dynamic variables problem..getUrl
      I needed to create a flash scrollbar with dynamically generated thumbnails that would link to a page and send the ImageID as a URL parameter. Could...
    4. Global variables - application variables vs include file
      What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include...
    5. Replacing code based on static variables to variable variables.
      Can anyone give me some help or tips in converting this code to take 2 variables that will specify the number of Pack type lines and the number of...
  3. #2

    Default Re: CF linking with variables

    If you have the ability to create links to the page from another with the
    options specified then you are partially on the right track.

    On your index page have links like this

    <a href="addbook.cfm?action=Sell">Sell a book</a>
    <a href="addbook.cfm?action=Request">Request a book</a>

    Then on your addbook page start with the following

    <cfif is defined("URL.action")>
    <cfset decidebk = URL.action>
    <cfelse>
    <cfset decidebk = "Sell">
    </cfif>

    Then you can use this variable to show or hide the fields.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "standal" <webforumsuser@macromedia.com> wrote in message
    news:d3jg31$3oo$1@forums.macromedia.com...
    > I want to give some background information first:
    >
    > I am making an online book selling/trading for a small group of people.
    They
    > can request a book or sell a book. On the form where they add their
    information
    > (addbook.cfm), I want it to only display certain fields depending on what
    they
    > want to do. So if they wish to sell a book, I do not want the book
    requesting
    > field to be viewable.
    >
    > I have an index.cfm page that will send them to addbook.cfm, but I want
    to
    > have two links: "Selling a Book" and "Requesting a Book". Depending on
    which
    > they click, they will only see the fields pertaining to their choice.
    >
    > On addbook.cfm I have <cfparam name=decidebk default="sell"> where
    decidebk is
    > my variable that holds the information. around the table rows I have
    > <cfif decidebk is "buy"> (table row with this field) <cfelse> (table rows
    with
    > selling information) </cfif>
    >
    > I was thinking that on the index page I would have
    > <a href="addbook.cfm?ID=#decidebk#">Sell a Book</a>
    > I dont think this is right, though, because I'm not sure how to tell it
    to
    > show the information for "Requesting a Book".
    >
    > I know this is extremely long and probably very confusing but I have
    tried so
    > much to no avail. Anything will help!!
    >

    Paul Whitham TMM Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139