 | 
October 7th, 2008, 06:26 PM
| | Newbie | | Join Date: Jul 2007
Posts: 10
| | radio buttons and element not defined error
Hi,
I am running a report using Cold Fusion. This report is generated by cfloop tag. Depends on the record count of a query, the report will list the data retrieved from the database. each row in the report will have a radio button, so there may be lots of radio buttons in this report. These radio buttons are defined in a form tag. User will select a radio button and then click a submit button to an action page to show more detail information.
The funky thing happens if I select first six or five buttons, I got either "page cannot displayed" or "save a file" window opened. I refreshed page and got error message tells me the radio button "viewReportButton" is not defined in the form. However, when I select other radio buttons, I got through. All the radio buttons have the same name but with different values.
If I have less radio buttons in the form, no such weird case happens. I tested it. When I have 42 or 46 radio buttons, I got the error.
Can anybody here tell me what's the problem? Thank you very much.
| 
October 7th, 2008, 07:00 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,774
| |
Can you post some of your code?
| 
October 7th, 2008, 07:09 PM
| | Newbie | | Join Date: Jul 2007
Posts: 10
| |
Thank you very much for your reply.
In detail report: - <cfform name="detailform" action="/Ecoater/AuditReport.cfm" method="post">
-
<cfloop index="i" from="1" to="#getCoilDetail.RecordCount#">
-
<cfif (i mod 2) is 0>
-
<cfset databgcolor = "e8e8e8">
-
<cfelse>
-
<cfset databgcolor = "f9f9f9">
-
</cfif>
-
<cfset databgcolor = "##" & databgcolor>
-
-
<tr align="right" class="data" bgcolor="<cfoutput>#databgcolor#</cfoutput>">
-
<td align="center"><a href="/Ecoater/CoilInquirySearchAction.cfm?coilNumFromDetailReport=<cfoutput>#getCoilDetail.coil_number[i]#</cfoutput>">
-
<cfoutput>#getCoilDetail.coil_number[i]#</cfoutput></a></td>
-
<td><cfoutput>#NumberFormat(getCoilDetail.actual_weight[i])# </cfoutput></td>
-
<td><cfoutput>#NumberFormat(getCoilDetail.tmw_weight[i])# </cfoutput></td>
-
<td><cfoutput>#NumberFormat(getCoilDetail.lineal_footage[i])# </cfoutput></td>
-
<td><div align="right"><cfoutput>#getCoilDetail.customer_po_number[i]# </cfoutput></div></td>
-
<td><div align="center"><cfoutput>#getCoilDetail.mill_coil_number[i]#</cfoutput></div></td>
-
<td><div align="center"><cfoutput>#getCoilDetail.mill_number[i]#</cfoutput></div></td>
-
<!--- jfu 09/05/06 add DateFormat --->
-
<td><div align="center"><cfoutput>#getCoilDetail.receiveDate[i]#</cfoutput></div></td>
-
<td><div align="center"><cfoutput>#getCoilDetail.location[i]#</cfoutput></div></td>
-
<td><cfoutput>#getCoilDetail.shop_order_number[i]# </cfoutput></td>
-
<td><cfoutput>#getCoilDetail.skid[i]# </cfoutput></td>
-
<td align=center><cfinput type="radio" name="viewReportbutton" value="#getCoilDetail.coil_number[i]#" required="yes" message="Please selected a coil to view audit report." >
-
</td>
-
</tr>
-
</cfloop>
-
-
<tr><Td colspan=12 align=right valign=middle style="padding-top:3"><cfinput type=submit name="submitButton" value="View Audit Report" >
-
</Td>
-
</tr>
-
</cfform>
-
<tr><Td colspan=12> </Td></tr>
-
------------ in audit report ----------- - <cfset coilnumber = '#form.viewReportbutton#'>
error happends here.
Last edited by acoder; October 7th, 2008 at 09:09 PM.
Reason: Added [code] tags
| 
October 7th, 2008, 09:14 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,774
| |
Set form.viewReportbutton to a default value using cfparam. I'm not sure what could be causing the error, but you should try that to begin with. If that doesn't help, try without cfinput, i.e. using normal input elements.
PS. please use code tags when posting code. Thanks.
| 
October 7th, 2008, 09:32 PM
| | Newbie | | Join Date: Jul 2007
Posts: 10
| |
Hi,
I tried both way and still get the same error. What puzzles me is that all the radio buttons generated from the same loop. Some radio buttons' values are submitted while some are not with value undefined. I don't know why. Even in undefined error, I got two different scenarioes. One is give me "page cannot display"; if I refresh, I can see the detail error message; the other gives me pop up window to ask me save or open the file, and then I can see 500 internal error.
Please help.
Thanks.
| 
October 7th, 2008, 09:45 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,774
| |
Can you give the rest of the code in the audit report page.
| 
October 7th, 2008, 09:52 PM
| | Newbie | | Join Date: Jul 2007
Posts: 10
| |
Here it is. Thank you. -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
<html>
-
-
<head>
-
-
<title>Coil Information Audit Report</title>
-
-
-
</head>
-
-
<body>
-
-
<cfparam name="FORM.viewReportbutton" default="">
-
-
-
<cfset coilnumber = "#Form.viewReportbutton#">
-
<cfset basecoilnumber = mid(coilnumber,1,7)>
-
-
<cflock timeout="10" throwontimeout="No" type="EXCLUSIVE" scope="SESSION">
-
<cfquery name="getAuditcoil" datasource="webs" dbtype="Oracle80">
-
-
select * from audit_sample where base_coil_number = '#basecoilnumber#'
-
-
</cfquery>
-
-
</cflock>
-
-
-
-
<table width="720" cellspacing="2" cellpadding="2" border="0">
-
<tr>
-
<td>
-
<cflock timeout="10" throwontimeout="No" type="READONLY" scope="SESSION">
-
<cfif #getAuditcoil.RecordCount# neq 0>
-
<br>
-
<div align="center" class="type">COIL AUDIT REPORT FOR BASE COIL NUMBER  <b><cfoutput>#basecoilnumber#</cfoutput></b></div>
-
<br>
-
<table width="720" border="0" cellspacing="1" cellpadding="1" >
-
<tr>
-
<td colspan="16" bgcolor="#000033" > </td>
-
</tr>
-
-
-
<tr bgcolor="#849ebb" class="coilHeader" align="right">
-
<td align="center">Coil Number</td>
-
<td align="center">Trans. Date</td>
-
-
</tr>
-
-
<cfloop index="i" from="1" to="#getAuditcoil.RecordCount#">
-
<tr class="data" bgcolor="#f9f9f9">
-
<td nowrap><cfoutput>#getAuditcoil.coil_number[i]#</cfoutput></td>
-
<td nowrap><cfoutput>#DateFormat(getAuditcoil.transaction_date[i],"dd-mmm-yyyy")#</cfoutput></td>
-
-
</tr>
-
-
</cfloop>
-
-
<tr>
-
<td colspan="16" bgcolor="#000033" > </td>
-
</tr>
-
</table>
-
-
<cfelse>
-
<p> </p>
-
<font face="Arial" SIZE="2">Cannot find audit information for this coil in the audit table</font>
-
-
</cfif></cflock>
-
</td>
-
</tr>
-
<tr><td><p> </p></td></tr>
-
</table>
-
</body>
-
</html>
-
-
-
-
-
Last edited by acoder; October 8th, 2008 at 07:38 AM.
Reason: Fixed code tags
| 
October 8th, 2008, 07:43 AM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,774
| |
Hmm, either I'm missing something simple or this is a strange problem.
OK, to eliminate the possibility of a problem from the client-side, try this code in your detail report page: - <form name="detailform" action="/Ecoater/AuditReport.cfm" method="post">
-
<cfloop index="i" from="1" to="42">
-
<input type="radio" name="viewReportbutton" value="somevalue<cfoutput>#i#</cfoutput>">
-
</cfloop>
-
</form>
|  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|