attach check box with database query result

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default attach check box with database query result

    When I create table to show result of a database query, I want to have a check
    box in front of each row. And When user select check box then save those rows
    in one files. Is that possible? If so how can I do it?

    sweetyp2005 Guest

  2. Similar Questions and Discussions

    1. Format query result.
      Hi ppl, Im having the time of my life with this database *sigh* Anyways, i have this problem which I can't solve. I would like to format the...
    2. displaying query result of 0 as N/A
      Hi I thought I could do this with an IsDefined function but I can't get it it to work. When I query my data I want to display a value of 0...
    3. How to deal with big query result?
      Greetings, In my search application, user can type a number to search. I use LIKE in my query. If a query result generates over 10,000...
    4. attach database
      hi, i have installed db2 udb v8.1 with fixpack 2 on my machine, then there is another machine installed same kind of server, so i am able to...
    5. how to add another column to a query result?
      hi guys, I have a query that will return 4 record with 1 column. I want to add another "title" column for the four record. The query is design so...
  3. #2

    Default Re: attach check box with database query result

    The action page (the one that is processed when a user clicks the submit
    button) will contain the value of each check box if it has been checked. Save
    this value in a database table. See sample code below, where the value "hello"
    is stored into the database field "foo" if the checkbox is checked. Otherwise,
    a null value is stored.



    <!--- form with checkbox --->
    <FORM ACTION="results.cfm" ... >
    <INPUT TYPE="checkbox" NAME="foo" VALUE="hello">
    <INPUT TYPE="submit">
    </FORM>

    <!--- this is results.cfm --->
    <CFPARAM NAME="foo" DEFAULT="">
    <CFQUERY NAME="bar" ... >
    INSERT INTO myTable (foo) VALUES ('#foo#')
    </QUERY>

    jdeline Guest

  4. #3

    Default Re: attach check box with database query result

    This would be easier accomplished (once you get over the learnign curve) by
    structures. Then you could save the whole structure to a text file or whereever
    you are saving it.

    [url]http://tutorial171.easycfm.com/[/url]

    jjsand28 Guest

  5. #4

    Default Re: attach check box with database query result

    How do you have the database table created. 1 row per result? (comma dilemited
    list of saved results?) or 1 row per saved result (as many rows created as
    checked results from form.

    The former will require 1 query insert, the latter will require 1 query insert
    inside of a cfloop (<cfloop list="#form.foo#" index="thisresult"><insert
    statement></cfloop>

    sample checkbox code (checkboxes give comma dilemited results for multiple
    checks on checkboxes with the same name) If all checkboxes are unchecked, then
    the result page won't even have the variable name (error checking needed here))

    <cfloop query="queryname">
    <input type="checkbox" name="foo" value="distinctvalue of query row">
    some text to describe the row results<br>
    </cfloop>



    coderWil 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