473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

radio buttons and element not defined error

10
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.
Oct 7 '08 #1
7 4323
acoder
16,027 Expert Mod 8TB
Can you post some of your code?
Oct 7 '08 #2
gengyue
10
Thank you very much for your reply.

In detail report:

Expand|Select|Wrap|Line Numbers
  1.     <cfform name="detailform" action="/Ecoater/AuditReport.cfm" method="post">
  2.                 <cfloop index="i" from="1" to="#getCoilDetail.RecordCount#">
  3.                     <cfif (i mod 2) is 0>
  4.                         <cfset databgcolor = "e8e8e8">
  5.                     <cfelse>
  6.                         <cfset databgcolor = "f9f9f9">
  7.                     </cfif>
  8.                 <cfset databgcolor = "##" & databgcolor>
  9.  
  10.         <tr align="right" class="data" bgcolor="<cfoutput>#databgcolor#</cfoutput>">
  11.             <td align="center"><a href="/Ecoater/CoilInquirySearchAction.cfm?coilNumFromDetailReport=<cfoutput>#getCoilDetail.coil_number[i]#</cfoutput>">
  12.                 <cfoutput>#getCoilDetail.coil_number[i]#</cfoutput></a></td>
  13.             <td><cfoutput>#NumberFormat(getCoilDetail.actual_weight[i])#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</cfoutput></td>
  14.             <td><cfoutput>#NumberFormat(getCoilDetail.tmw_weight[i])#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</cfoutput></td>
  15.             <td><cfoutput>#NumberFormat(getCoilDetail.lineal_footage[i])#&nbsp;&nbsp;&nbsp;&nbsp;</cfoutput></td>
  16.             <td><div align="right"><cfoutput>#getCoilDetail.customer_po_number[i]#&nbsp;&nbsp;&nbsp;&nbsp;</cfoutput></div></td>
  17.             <td><div align="center"><cfoutput>#getCoilDetail.mill_coil_number[i]#</cfoutput></div></td>
  18.             <td><div align="center"><cfoutput>#getCoilDetail.mill_number[i]#</cfoutput></div></td> 
  19.             <!--- jfu 09/05/06 add DateFormat --->
  20.             <td><div align="center"><cfoutput>#getCoilDetail.receiveDate[i]#</cfoutput></div></td>
  21.             <td><div align="center"><cfoutput>#getCoilDetail.location[i]#</cfoutput></div></td>
  22.             <td><cfoutput>#getCoilDetail.shop_order_number[i]#&nbsp;&nbsp;</cfoutput></td>
  23.             <td><cfoutput>#getCoilDetail.skid[i]#&nbsp;&nbsp;</cfoutput></td>
  24.             <td align=center><cfinput type="radio" name="viewReportbutton" value="#getCoilDetail.coil_number[i]#" required="yes" message="Please selected a coil to view audit report." > 
  25.                     </td>
  26.         </tr>                
  27.             </cfloop>
  28.  
  29.             <tr><Td colspan=12 align=right valign=middle style="padding-top:3"><cfinput type=submit name="submitButton" value="View Audit Report" >
  30.             </Td>
  31.             </tr>
  32.             </cfform>
  33.             <tr><Td colspan=12>&nbsp;</Td></tr>
  34.  
------------ in audit report -----------

Expand|Select|Wrap|Line Numbers
  1. <cfset coilnumber = '#form.viewReportbutton#'>
error happends here.
Oct 7 '08 #3
acoder
16,027 Expert Mod 8TB
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.
Oct 7 '08 #4
gengyue
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.
Oct 7 '08 #5
acoder
16,027 Expert Mod 8TB
Can you give the rest of the code in the audit report page.
Oct 7 '08 #6
gengyue
10
Here it is. Thank you.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3.  
  4. <head>
  5.  
  6.     <title>Coil Information Audit Report</title>
  7.  
  8.  
  9. </head>
  10.  
  11. <body>
  12.  
  13. <cfparam name="FORM.viewReportbutton" default="">
  14.  
  15.  
  16. <cfset coilnumber = "#Form.viewReportbutton#">
  17. <cfset basecoilnumber = mid(coilnumber,1,7)>
  18.  
  19. <cflock timeout="10" throwontimeout="No" type="EXCLUSIVE" scope="SESSION">
  20.         <cfquery name="getAuditcoil" datasource="webs" dbtype="Oracle80">
  21.  
  22.             select * from audit_sample  where base_coil_number = '#basecoilnumber#'
  23.  
  24.         </cfquery>
  25.  
  26. </cflock>
  27.  
  28.  
  29.  
  30. <table width="720" cellspacing="2" cellpadding="2" border="0">
  31. <tr>
  32.     <td>
  33.     <cflock timeout="10" throwontimeout="No" type="READONLY" scope="SESSION">
  34.         <cfif #getAuditcoil.RecordCount# neq 0>
  35.         <br>
  36.         <div align="center" class="type">COIL AUDIT REPORT FOR&nbsp;BASE COIL NUMBER&nbsp <b><cfoutput>#basecoilnumber#</cfoutput></b></div>
  37.         <br>
  38.         <table width="720" border="0" cellspacing="1" cellpadding="1" >
  39.         <tr>
  40.             <td colspan="16" bgcolor="#000033" >&nbsp;</td>
  41.         </tr>
  42.  
  43.  
  44.         <tr bgcolor="#849ebb" class="coilHeader" align="right">
  45.                 <td align="center">Coil Number</td>
  46.                 <td align="center">Trans. Date</td>
  47.  
  48.                             </tr>
  49.  
  50.             <cfloop index="i" from="1" to="#getAuditcoil.RecordCount#">
  51.                 <tr class="data" bgcolor="#f9f9f9">
  52.                     <td nowrap><cfoutput>#getAuditcoil.coil_number[i]#</cfoutput></td>
  53.                     <td nowrap><cfoutput>#DateFormat(getAuditcoil.transaction_date[i],"dd-mmm-yyyy")#</cfoutput></td>
  54.  
  55.                 </tr>
  56.  
  57.             </cfloop>
  58.  
  59.             <tr>
  60.             <td colspan="16" bgcolor="#000033" >&nbsp;</td>
  61.             </tr>
  62.             </table>    
  63.  
  64.             <cfelse>
  65.             <p>&nbsp;</p>
  66.                 <font face="Arial" SIZE="2">Cannot find audit information for this coil in the audit table</font>
  67.  
  68.             </cfif></cflock>
  69. </td>
  70. </tr>
  71. <tr><td><p>&nbsp;</p></td></tr>
  72. </table>
  73. </body>
  74. </html>
  75.  
  76.  
  77.  
  78.  
  79.  
Oct 7 '08 #7
acoder
16,027 Expert Mod 8TB
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:
Expand|Select|Wrap|Line Numbers
  1. <form name="detailform" action="/Ecoater/AuditReport.cfm" method="post">
  2.     <cfloop index="i" from="1" to="42">
  3. <input type="radio" name="viewReportbutton" value="somevalue<cfoutput>#i#</cfoutput>">
  4.     </cfloop>
  5. </form>
Oct 8 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Phil Powell | last post by:
<b>Agency 4</b> <input type="radio" name="permission" value="1" checked> Yes <input type="radio" name="permission" value="0" > No <br> <b>Agency 5</b> <input type="radio" name="permission"...
3
by: Eric Chang | last post by:
I was working on this simple form with radio boxes. And when I click on one of the radio box, it tell me the value is "undefined" Why is that ? I did defined the value of each radio box: ...
3
by: Owen Funkhouser | last post by:
I have a form with three radio options. And I have three buttons: <input type="submit" name="mainform_action" value="Edit Data"> <input type="submit" name="mainform_action" value="View Data">...
4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
3
by: ewitkop90 | last post by:
Here is my code: <SCRIPT> function transportchange(transport) { if (framenewinstall.Helpdesk.checked) framenewinstall.Helpdesk.checked=false; if (framenewinstall.CircuitNumber.checked)...
16
by: Stuart | last post by:
I have a page where I utilise the left and right cursor keys to change an image, also on this page is a groups of radio buttons, unfortunately when a radio button is clicked the focus for the...
7
by: nathaniel.k.lee | last post by:
Is it not possible, in IE, to dynamically click a radio button? I'm grabbing some values from a database and using them to populate radio buttons on a page. I have alternate code for Firefox...
22
by: Saul | last post by:
I have a set of radio buttons that are created dynamically, after rendered I try loop thru this set by getting the length of the set, but I keep getting an error stating the element is undefined. I...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.