Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Results from CFQUERY in table with checkbox 1

Status
Not open for further replies.

TheVMan

IS-IT--Management
Feb 19, 2001
110
0
0
US
I am returning results of a query into a table. I've added a column to the table for a checkbox, to update the table if the value is true, when they commit the changes. I can't get this code formatted properly, nor will it post the values to my next page, where I run my update query. Thanks in advance.

<TABLE border=1 VALIGN=&quot;center&quot; cellpadding=1 cellspacing=1 style=&quot;HEIGHT: 64px; WIDTH: 520px&quot;>
<TR>
<TD><STRONG><FONT size=2>User ID </FONT></STRONG>
</TD>
<TD><STRONG><FONT size=2>Name </FONT></STRONG>
</TD>
<TD><FONT size=2><STRONG>Universe Requested </STRONG></FONT>
</TD>
<TD>
<P align=center><STRONG><FONT size=2>Approve User? </FONT></STRONG></P>
</TD>
</TR>

<CFOUTPUT QUERY=&quot;pendingrequests&quot;>
<TR VALIGN=&quot;center&quot;>

<TD VALIGN=&quot;center&quot;><FONT size=2>#USER_ID# </FONT>
</TD>
<TD VALIGN=&quot;center&quot;><FONT size=2>#NAME#
</FONT>
</TD>
<TD VALIGN=&quot;center&quot;><FONT size=2>#UNV_REQUESTED#
</FONT>
</TD>
<TD VALIGHN=&quot;center&quot;><FONT size=2></FONT>
<P align=center><INPUT name=approve type=checkbox value=1></P>
</TD>

</CFOUTPUT>
</TABLE>
<br>
<form action=&quot;approved.cfm&quot; method=&quot;post&quot;>
<input type=&quot;submit&quot; value=&quot;Continue&quot;>
</form>
 
Are you trying to approve/deny everything the query returns or selected rows? What happens when you post the form? Take note that variable names of unchecked checkboxes do not get passed onto the next page, when posted.

Klotzki

 
Yes, I'm trying to approve/deny selected rows. I am ignoring the results of enchecked boxes. On the approved.cfm page, I set a CFPARAM of that checkbox to zero by default, and they use CFIF to see if it is equal to one, then update the column in the table with a Y. Nothing is happening in my table. I know the query works, it's just not passing values properly. Thanks for the response.
 
as the unchecked checkboxes are NOT passed, the cfparam was a good idea, but it would be cleaner to use <cfif isdefined(&quot;approve&quot;)> as you don't have to manage the values - and therefore minimize the risks ;]
 
You might wanna try and define you input tag within the form that's being submitted. That could be the reason why your variables is'nt passed to the processing form...

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top