forms inside dynamic tables

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default forms inside dynamic tables

    Ok I have a dynamic table, and I put a form in it. What I want is for there to
    be a table that lists all the info for the computers. And the last column of
    the table has a form that asks who you want the computer to go to and where.
    Then you can click submit to assign that computer. Mine works almost the way I
    want it, except for the list menu, where you select the location. It is only
    showing the first location instead of all of them. I made sure the query was
    right and it is.

    I have this:

    <table border="1" cellpadding="1" cellspacing="1">
    <tr>
    <td>ServiceTag</td>
    <td>Model</td>
    <td>Type</td>
    <td>Memory</td>
    <td>&nbsp;</td>
    </tr>
    <cfoutput query="Recordset1">
    <tr>
    <td>#Recordset1.ServiceTag#</td>
    <td>#Recordset1.Model#</td>
    <td>#Recordset1.Type#</td>
    <td>#Recordset1.Memory#</td>
    <td><form name="form1" method="get" action="untitled.cfm">
    <p>
    <input name="st" type="hidden" id="st"
    value="#Recordset1.ServiceTag#">
    assign to
    <input name="uname" type="text" id="uname">
    at
    <select name="select">
    <option
    value="#Recordset2.Location#">#Recordset2.Location #</option>
    </select>
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form></td>
    </tr>
    </cfoutput>
    </table>

    PeteMares Guest

  2. Similar Questions and Discussions

    1. forms inside data grid
      I meet a quite strange problem. When I output forms insides a dat grids, it seems that some of the forms will not even function when clicked a...
    2. Flash forms do not show up inside html table
      Will the cf 7.0 Flash forms show up inside a table?? If I surround any flash form with a simple set of table tags (<table><tr><td></td></tr></table>...
    3. Flash forms and tables
      I've been beating my head on the wall for about 2 weeks now trying to figure this one out: If I place a flash form inside of a table, I get...
    4. Dynamic tables
      Hi All, I have an MS Access Database for my website which contains a table "tblProduct Images." The table breaks down to three columns...
    5. Dynamic temp. datagrid col.gen. -Session access inside a class inside a UserCtrl
      Hello Dear Professionals: Based on this document:...
  3. #2

    Default Re: forms inside dynamic tables

    Hi Pete,

    Your select box code,

    <select name="select">
    <option value="#Recordset2.Location#">#Recordset2.Location #</option>
    </select>

    Will always return one and only one record from the Recordset2 query. You
    need to spin through the recordset to grab all the records, and then use a CFIF
    statement to highlight or SELECT the location that currently "belongs" to the
    computer.

    So,
    <select name="select">
    <cfloop query="Recordset2"> <!--- we use CFLOOP here because you're already in
    a CFOUTPUT section --->

    <option value="#Location#" #iif(location eq
    Recordset1.location,de("selected"),de(""))#>#Locat ion#</option>

    </cfloop>
    You may have to play with the IIF statement to get the processor to look at
    the current record in the CFOUTPUT loop. Sorry I'm not spot on with that but
    I'm away from the code library right now.
    HTH,
    </select>


    philh Guest

  4. #3

    Default Re: forms inside dynamic tables

    Thanks for the help :)
    PeteMares 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