#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    39
    Rep Power
    11

    Weird Issue just popped up


    I have a web form that's been working for the last 2 months and now is throwing the following error.

    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.

    The page lists out all of the members of a company with check boxes next to each persons name so that the person submitting the form may select who the would like to submit. The weird thing is if I keep this list to 15 people it will submit fine but once I go above 15 people I get the 500 error but no error in the CF logs. Like I said above, this was working for the last 2 months and now is not.

    I'm getting no CF errors when the form is submitted, it's almost like it doesn't even recognize the form submit. I've tried dumping the form inside the isDefined("form.submitAviation") and it never gets to it.

    Code:
    <cfif isDefined("form.submitAviation")>
        
        <cfif not isDefined("form.ss_accident")>
        	<cfset errorModel.errornew("ss_accident","Has the company had an accident?") />
            <cfset form.accidentYN = '' />
        </cfif>
        
        <cfif isDefined("form.ss_accident") and form.ss_accident eq 1 and form.ss_accident_date eq ''>
    		<cfset errorModel.errornew("ss_accident_date","Please enter the date of the accident.") />
            <cfset form.ss_accident_date = '' />
        </cfif>
        
        <cfif not isDefined("form.memberID")>
        	<cfset errorMessage = 'You must select at least one employee and complete their corresponding fields.' />
        <cfelse>
        	<cfloop list="#form.memberID#" index="i">
            	<cfif #form["ss_occupation"&i]# eq ''>
    				<cfset occupationFieldName = "ss_occupation"&#i# />
                    <cfset errorModel.errornew("#occupationFieldName#","Required.") />
                </cfif>
                
                <cfif #form["ss_years_since"&i]# eq ''>
    				<cfset additionalYearsFieldName = "ss_years_since"&#i# />
                    <cfset errorModel.errornew("#additionalYearsFieldName#","Required.") />
                </cfif>
                
                <cfif #form["ss_retire"&i]# eq ''>
    				<cfset retiringFieldName = "ss_retire"&#i# />
                    <cfset errorModel.errornew("#retiringFieldName#","Required.") />
                </cfif>
                
                <cfset nextAwardLevel = member.getAward(awardType=ss_award,firstTime=#form["ss_first_time"&i]#,certificate=#form["ss_years_prev"&i]#,newAmount=#form["ss_years_since"&i]#) />
    			<cfif nextAwardLevel.certificate eq 0>
                    <cfset errorMessage = 'Not all members are eligible for an award at this time. Please review and deselect the ineligible members.<br />' />
                </cfif>
            </cfloop>
        </cfif>
        
        
        
        <cfif not errorModel.findError() and errorMessage eq ''>
        	<!--- process data --->
            <cfset saveApplication = member.saveAviationSupport(argumentCollection=form) />
          
        </cfif>
        
    </cfif>
        <!-- googleon: index -->
            <div id="titleBar" class="greyBar">
                <h1 class="sifr">Flying Safety Awards</h1>
                <div id="rightSideControls">
                <cfinclude template="/_includes/print-share.cfm">
                </div>
            </div>
            <div id="pageContent" class="full">
            	
            	<h2 class="sifr">Award</h2>
            	
                <cfif qAllEmployees.recordCount gt 0>
                <cfoutput>
                <cfset z=Encrypt(qIndInfo.co_ID, ckey) />
                <cfif errorModel.findError() or errorMessage neq ''>
                	<div class="flash_error">An error has occured. Please review the form below. <cfif errorMessage neq ''><br /><br />#errorMessage#</cfif></div>
                </cfif>
                
    			<form class="formLayout" action="#cgi.SCRIPT_NAME#" method="post">
                
                	<input type="hidden" name="currentMemberID" value="#ID#" />
                    <input type="hidden" name="ss_status" value="<cfif isMemberRep>Verified<cfelse>#ss_status#</cfif>" />
                    <input type="hidden" name="ss_award" value="#ss_award#" id="ss_award" />
                    <input type="hidden" name="isMemberRep" value="#isMemberRep#" />
                    <input type="hidden" name="awardName" value="Award" />
                    <input type="hidden" name="ss_entered_by" value="#ID#" />
                    <input type="hidden" name="ss_year" value="#ss_year#" id="ss_year" />
                    
                    <label>Award Year: </label>
                    #ss_year#<br />
                    
                    <label>Company Name:</label>
                    #qIndInfo.company#<br>
                    
                    <label>Has your company ever had an accident?</label>
                    <input type="radio" class="radiobutton" id="accidentN" name="ss_accident" value="0" <cfif ss_accident eq 0>checked="checked"</cfif> /><label class="radiobutton" for="accidentN"> No</label>
                    <input type="radio" class="radiobutton" id="accidentY" name="ss_accident" value="1" <cfif ss_accident eq 1>checked="checked"</cfif> /><label class="radiobutton" for="accidentY"> Yes</label>
                    <span class="fieldRequired">#errorModel.writeError("ss_accident","Has your company had an accident?","accidentYN-edit-error")#</span>
                    <br />
                    <cfset currentYear = dateformat(now(),'yyyy') />
                    <script type="text/javascript">
    					$(function() {
    						$( "##accidentDate" ).datepicker({changeMonth: true, changeYear: true, yearRange: '1900:<cfoutput>#currentYear#</cfoutput>'});
    					});
    				</script>
                    <label for="accidentDate">If yes, what was the date of the accident?:</label><input type="text" id="accidentDate" class="mediumTextBox" size="20" value="#ss_accident_date#" name="ss_accident_date" />
                    <span class="fieldRequired">#errorModel.writeError("ss_accident_date","Accident Date is required.","accidentDate-edit-error")#</span>
                    <br />
                    
                    <p><strong>Substantiating Data:</strong></p>
                   
                    <cfif errorMessage neq ''>
                        <div class="fieldRequired">#errorMessage#</div>
                    </cfif>
                    <table id="alternatecolor" class="altrowstable">
                        <tr>
                            <th valign="top">Employee Name</th>
                            <th valign="top">Occupation</th>
                            <th valign="top">Previous Award?</th>
                            <th valign="top">Total Years Last Award</th>
                            <th valign="top">Years Applying Toward Award</th>
                            <th valign="top">Retiring?</th>
                            <th valign="top">Award</th>
                        </tr>
    					
                        <cfloop query="qAllEmployees">
                        <cfset previousYearsHours = member.getPreviousYearsHours(id=qAllEmployees.ID,awardType='SUPPORT') />
                        
                        <script type="text/javascript">
    						$(document).ready(function() {
    	
    						$("##ss_years_since<cfoutput>#qAllEmployees.ID#</cfoutput>").change(function(){
    							
    							var ss_award = $('##ss_award').val();
    							var ss_certificate = $('##ss_years_prev<cfoutput>#qAllEmployees.ID#</cfoutput>').val();
    							var ss_first_time = $('##ss_first_time<cfoutput>#qAllEmployees.ID#</cfoutput>').val();
    							var ss_years_since = $('##ss_years_since<cfoutput>#qAllEmployees.ID#</cfoutput>').val();
    							var datastring = "awardType=" + ss_award + "&certificate="+ss_certificate + "&newAmount="+ss_years_since + "&output=page" + "&firstTime="+ss_first_time;
    							
    							$.ajax({
    								type: "POST",
    								url: "/member/safety-awards/cfc/memberModel.cfc?method=getAward",
    								data: datastring,
    								success: function(data){
    									$('##awardLevel<cfoutput>#qAllEmployees.ID#</cfoutput>').html(data);
    									
    									}
    								});
    							}); 
    						}); 
    								
    					</script>
                        
                        <input type="hidden" name="ss_certificate#qAllEmployees.ID#" value="<cfif previousYearsHours.ss_certificate neq ''>#previousYearsHours.ss_certificate#<cfelse>0</cfif>" id="ss_certificate#qAllEmployees.ID#" />
                        
                        <tr class="row_to_clone">
                            <td valign="top">
                            	<input type="checkbox" class="checkbox" id="#qAllEmployees.ID#" name="memberID" value="#qAllEmployees.ID#" <cfif isDefined("form.memberID") and ListFind(form.memberID,qAllEmployees.ID)>checked="checked"</cfif> /><label class="checkbox150" for="#qAllEmployees.ID#"> #qAllEmployees.first_name# #qAllEmployees.last_name#</label>
                           		<cfif errorModel.findError()><span class="fieldRequired">#errorModel.writeError(memberID,"Required","edit-error")#</span></cfif>
                            </td>
                            <td valign="top">
    							<cfset variables.occupation = utilities.getLookup('occupation') />
                                <select name="ss_occupation#qAllEmployees.ID#" class="select100">
                                    <option value=""></option>
                                    <cfloop index="indOption" from="1" to="#ArrayLen(variables.occupation)#">
                                    <cfset eachOption = variables.occupation[indOption]>
                                    <option value="#eachOption.fieldValue#" <cfif (isDefined("form.ss_occupation#qAllEmployees.ID#") and #form['ss_occupation'&qAllEmployees.ID]# eq eachOption.fieldValue) or previousYearsHours.ss_occupation eq eachOption.fieldValue>selected="selected"</cfif>>#eachoption.fieldLabel#</option>
                                    </cfloop>
                                </select>
                                <cfset occupationFieldName = "ss_occupation"&#qAllEmployees.ID# />
                           		<cfif errorModel.findError()><span class="fieldRequired">#errorModel.writeError(occupationFieldName,"Occupation Required","edit-error")#</span></cfif>
                            </td>
                            <td valign="top">
                                <cfif previousYearsHours.recordCount gt 0>Yes<cfelse>No</cfif>
                                <input type="hidden" name="ss_first_time#qAllEmployees.ID#" id="ss_first_time#qAllEmployees.ID#" value="<cfif previousYearsHours.recordCount gt 0>0<cfelse>1</cfif>" />
                            </td>
                            <td valign="top">
                            	<cfif previousYearsHours.recordCount gt 0>#previousYearsHours.ss_years_total#<cfelse>N/A</cfif>
                                <input type="hidden" name="ss_years_prev#qAllEmployees.ID#" id="ss_years_prev#qAllEmployees.ID#" value="<cfif previousYearsHours.recordCount gt 0>#previousYearsHours.ss_years_total#<cfelse>0</cfif>" />
                                
                            </td>
                            <td valign="top">
                            	<input type="text" class="textBox40" name="ss_years_since#qAllEmployees.ID#" value="<cfif isDefined("form.ss_years_since#qAllEmployees.ID#")>#form['ss_years_since'&qAllEmployees.ID]#</cfif>" id="ss_years_since#qAllEmployees.ID#" />
                                
                                <cfset additionalYearsFieldName = "ss_years_since"&#qAllEmployees.ID# />
                           		<span class="fieldRequired"><br />#errorModel.writeError(additionalYearsFieldName,"Additional Years Required","edit-error")#</span>
                            </td>
                            
                            <td valign="top">
                                <select name="ss_retire#qAllEmployees.ID#" class="smallSelect">
                                    <option value=""></option>
                                    <option value="1" <cfif (isDefined("form.ss_retire#qAllEmployees.ID#") and #form['ss_retire'&qAllEmployees.ID]# eq 1) or previousYearsHours.ss_retire eq 1>selected="selected"</cfif>>Yes</option>
                                    <option value="0" <cfif (isDefined("form.ss_retire#qAllEmployees.ID#") and #form['ss_retire'&qAllEmployees.ID]# eq 0) or previousYearsHours.ss_retire eq 0>selected="selected"</cfif>>No</option>
                                </select>
                                <cfset retiringFieldName = "ss_retire"&#qAllEmployees.ID# />
                           		<cfif errorModel.findError()><span class="fieldRequired">#errorModel.writeError(retiringFieldName,"Retiring Required","edit-error")#</span></cfif>
                            </td>
                            <td valign="top">
                            	<span id="awardLevel#qAllEmployees.ID#"></span>
                            </td>
                        </tr>
                        </cfloop>
                        <cfset previouslySubmitted = member.getSupportServicesSubmitted(coID=qIndInfo.co_ID) />
                        <cfif previouslySubmitted.recordCount gt 0>
                            <tr>
                                <td valign="top" colspan="7"><strong>Employees already submitted for the current award year.</strong></th>
                            </tr>
                            <tr>
                                <th valign="top">Employee Name</th>
                                <th valign="top">Occupation</th>
                                <th valign="top">Previous Award?</th>
                                <th valign="top">Total Years At Time of Last Award</th>
                                <th valign="top">Years Applying Towards Award</th>
                                <th valign="top">Retiring?</th>
                                <th valign="top">Award</th>
                            </tr>
                            <cfloop query="previouslySubmitted">
                            	<cfset nextAward = member.getAward(awardType='SUPPORT',firstTime=previouslySubmitted.ss_first_time,certificate=previouslySubmitted.ss_years_prev,newAmount=previouslySubmitted.ss_years_since) />
                            	<tr>
                                	<td valign="top">#previouslySubmitted.full_name#</td>
                                    <td valign="top">#previouslySubmitted.ss_occupation#</td>
                                    <td valign="top"><cfif previouslySubmitted.ss_first_time eq 1>No<cfelse>Yes</cfif></td> 
                                    <td valign="top">#previouslySubmitted.ss_years_prev#</td>
                                    <td valign="top">#previouslySubmitted.ss_years_since#</td>
                                    <td valign="top"><cfif previouslySubmitted.ss_retire eq 0>No<cfelse>Yes</cfif></td>
                                    <td valign="top">#nextAward.award#</td>
                                </tr>
                            </cfloop>
                        </cfif>
                    </table>
                  
                    <input type="submit" name="submitAviation" class="submitButton" value="Submit Application" />
                    <br />
                </form>
                
                </cfoutput>
    			<cfelse>
                	<div class="flash_error">Applications have already been submitted for every employee.  Only one application per employee is allowed each year.</div>
                </cfif>
            </div>
            
            <div id="bottomEdge"></div>
        </div>
        <!-- googleoff: index -->
        <div id="footer">
        	<cfinclude template="/_includes/footer.cfm">
        </div>
    </div>
    </td></tr></table>
    </body>
    </html>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    11
    If CF isn't logging an error, the web server (IIS maybe?) should be logging one. If not, make sure logging is turned on on both IIS and CF admin.

    Either that, or start commenting chunks of code till you narrow down what's causing the problem.
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,286
    Rep Power
    968
    If you're on IE, try it in Chrome or Firefox. IE has (or used to have, I don't use it any more) a ridiculous option for "friendly error pages" that was turned on and would mask the actual error output.

    That said, I definitely don't have 15 minutes to wade through the huge block of code you sent. So if it keeps up, please remove pieces of the code until you are left with the minimum needed to trigger the errror.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    7
    In addition to the suggestions above, you should dump the FORM scope at the very top of the page (or enable full debugging). So you can what, if anything, is being submitted.

IMN logo majestic logo threadwatch logo seochat tools logo