Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
PeteMares #1
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> </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
-
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... -
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>... -
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... -
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... -
Dynamic temp. datagrid col.gen. -Session access inside a class inside a UserCtrl
Hello Dear Professionals: Based on this document:... -
philh #2
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
-



Reply With Quote

