views:

83

answers:

1

I have a form that updates on the same page is it on...this form worked last week and I have not touched the code AT ALL. What could have changed? :\

"It is not working.." as in...once the information is submitted, the information in the database is not updated. :\

NOTE: I KNOW I need to replace things with cfparam...don't worry about that part.

Another Note: this page is included in a tabbed area (jquery UI tabs)

I have tried to debug this with firebug...but I get no errors... :\

Here is the code:

<!-- Submit form handles -->
<cfif isdefined("form.buttonGen")>

  <cfparam name="form.TeachingLevel" default="None">
  <cfif #form.FundSource# IS 'Other'>
    <cfset form.FundSource = #form.FundSourceOther#>
  </cfif>

  <cfquery name="savePeople" datasource="#sacsds#" username="#sacsuser#" password="#sacsuser#">
  UPDATE faculty.dbo.SACS_Person
  SET Status = '#form.Status#',
  FundSource = '#form.FundSource#',
  TeachingLevel = '#form.TeachingLevel#',
  TeachingFields = '#form.TeachingFields#',
  MeetsReq = '#form.MeetsReq#', 
  GraduateHours = '#form.GraduateHours#',
  MeetsQual = '#form.MeetsQual#',
  Justification = '#form.Justification#'
  WHERE IDNum = <cfqueryparam cfsqltype="cf_sql_varchar" value="#session.fperson#"> AND
  DeptCode = '#session.DeptCode#'
  </cfquery>


<cfif ISDEFINED("form.VitaFile") AND form.VitaFile IS NOT ''>


    <cffile action="upload" filefield="form.VitaFile" destination="#VitaLoc#" nameconflict="makeunique">
    <cfset form.VitaURL = "#VitaPath#/#cffile.serverfile#">
        <cfquery name="saveVita" datasource="#sacsds#" username="#sacsuser#" password="#sacsuser#">
        UPDATE faculty.dbo.SACS_Person
         SET vitaURL =   '#form.vitaURL#'
         WHERE idnum LIKE '#form.idnum#'
        AND  deptCode LIKE '#form.deptCode#'
        </cfquery>

</cfif>



</cfif>
<div id = "dialog2">
<b>Saved.</b> 
</div>





<!-- The form -->
<cfif session.security GT 1>
<h3><cfoutput>#getP.FullName#</cfoutput></h3>
<cfform  name="form1" enctype="multipart/form-data" id = "docForm" >
<table class = "general">
  <tr>
    <td><strong>Status</strong></td>
    <td><cfinput type="radio" name="Status" value="Regular Faculty" checked="checked" />
      Regular Faculty
      <cfif results.Status IS "Visiting Faculty"><cfinput type="radio" name="Status" value="Visiting Faculty"  CHECKED />
      <cfelse>
      <cfinput type="radio" name="Status" value="Visiting Faculty" />
      </cfif>
        Visiting Faculty<br />
      <cfif results.Status IS "Adjunct">
        <cfinput type="radio" name="Status" value="Adjunct" CHECKED />
        <cfelse>
        <cfinput type="radio" name="Status" value="Adjunct" /></cfif>
        Adjunct
      <cfif results.Status IS "Graduate or Teaching Assistant">
        <cfinput type="radio" name="Status" value="Graduate or Teaching Assistant" CHECKED />
      <cfelse>
        <cfinput type="radio" name="Status" value="Graduate or Teaching Assistant" />
      </cfif>
    Grad or Teaching Asst </td>
  </tr>
  <tr>
    <td><strong>Funding Source</strong></td>
    <td>
    <cfinput type="radio" name="FundSource" value="EG" checked="checked" />
      E&amp;G
      <cfif results.FundSource IS "Grant Contract">
      <cfinput type="radio" name="FundSource" value="Grant Contract" CHECKED />
      <cfelse>
      <cfinput type="radio" name="FundSource" value="Grant Contract" />
      </cfif>
      Grant Contract
      <cfif results.FundSource IS "Auxiliary">
      <cfinput type="radio" name="FundSource" value="Auxiliary" CHECKED />
      <cfelse>
      <cfinput type="radio" name="FundSource" value="Auxiliary" />
      </cfif>
      Auxiliary<br />
      <cfif results.FundSource IS NOT "Grant Contract" AND results.FundSource IS NOT "Auxiliary" AND results.FundSource IS NOT "EG">
      <cfinput type="radio" name="FundSource" value="Other" CHECKED />
      <cfelse>
      <cfinput type="radio" name="FundSource" value="Other" />
      </cfif>
      Other:
     <cfif results.FundSource IS NOT "Grant Contract" AND results.FundSource IS NOT "Auxiliary" AND results.FundSource IS NOT "EG">
     <cfoutput>
    <cfinput type="text" name="FundSourceOther" size="35" value="#results.FundSource#" />
    </cfoutput>
    <cfelse>
    <cfinput type="text" name="FundSourceOther" size="35" value="" />
    </cfif>
    </td>
  </tr>
  <tr>
    <td><strong>Teaching Levels</strong></td>
    <td>
    <cfif FindNoCase('Lower Division', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="Lower Division" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="Lower Division" />
    </cfif>
      Lower Division
    <cfif FindNoCase('Masters', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="Masters" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="Masters" />
    </cfif>
    Master's
    <cfif FindNoCase('Doctorate', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="Doctorate" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="Doctorate" />
    </cfif>
    Doctorate<br />
    <cfif FindNoCase('Upper Division', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="Upper Division" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="Upper Division" />
    </cfif>
    Upper Division
    <cfif FindNoCase('Specialist', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="Specialist" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="Specialist" />
    </cfif>
    Specialist
    <cfif FindNoCase('None', #results.TeachingLevel#) IS NOT 0>
    <cfinput type="checkbox" name="TeachingLevel" value="None" CHECKED />
    <cfelse>
    <cfinput type="checkbox" name="TeachingLevel" value="None"  />
    </cfif>
    None </td>
  </tr>
  <tr>
    <td><strong>Teaching Fields</strong></td>
    <td><cfinput type="text" name="TeachingFields" size="35" value="#results.TeachingFields#"></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><strong>Meets faculty requirements based upon advanced academic work in the teaching fields.</strong><br />
      &nbsp;
      <cfinput type="radio" name="MeetsReq" value="Yes" checked="checked" />
      Yes
      <cfif results.MeetsReq IS "No">
      <cfinput type="radio" name="MeetsReq" value="No" CHECKED />
      <cfelse>
      <cfinput type="radio" name="MeetsReq" value="No"  />
      </cfif>

    No </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><strong>Graduate semester hours in teaching field</strong>
      <br />
      <cfinput type="radio" name="GraduateHours" value="0-17" checked="checked" />
      0-17
      <cfif results.GraduateHours IS "18-29">
      <cfinput type="radio" name="GraduateHours" value="18-29" CHECKED />
      <cfelse>
      <cfinput type="radio" name="GraduateHours" value="18-29" />
      </cfif>
      18-29
      <cfif results.GraduateHours IS "30+">
      <cfinput type="radio" name="GraduateHours" value="30+" CHECKED />
      <cfelse>
      <cfinput type="radio" name="GraduateHours" value="30+" />
      </cfif>
      30 and above </td>
    </tr>
  <tr>
    <td colspan="2" align="center"><strong>Meets qualifications based upon &quot;demonstrated competencies and achievements that contribute to effective teaching and student learning outcomes&quot; in lieu of advanced academic preparation.</strong><br />
      <cfinput type="radio" name="MeetsQual" value="Yes" checked="checked" />
      Yes
      <cfif results.MeetsQual IS "No">
      <cfinput type="radio" name="MeetsQual" value="No" CHECKED />
      <cfelse>
      <cfinput type="radio" name="MeetsQual" value="No" />
      </cfif>
        No </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><strong>If &quot;yes&quot;, describe the manner in which the competence and achievement were demonstrated. If &quot;no,&quot; describe the circumstances justifying the hiring.</strong>

      <br />
      <br />
      <cftextarea name="Justification" cols="70" rows="5"><cfoutput>#results.Justification#</cfoutput></cftextarea>
      </td>
  </tr>
  <tr>
    <td colspan="2" align="center">
      <cfinput type="submit" name="buttonGen" id="buttonGen"  value="Save Changes"  />
      </td>
  </tr>
</table>
<cfoutput>
<cfinput type="hidden" name="VitaURL" value="#results.VitaURL#">
<cfinput type="hidden" name="CollegeCode" value="#session.CollegeCode#">
<cfinput type="hidden" name="DeptCode" value="#session.DeptCode#">
<cfinput type="hidden" name="IDNum" value="#session.fperson#">
</cfoutput>
</cfform>
<cfelse>
</cfif>
A: 

Apparently, the jquery dialog that tells the user the content was saved...was preventing the query from running. Strange...oh well no pretty dialog. :\ Doesn't work with the way I have things going. I'd have to do my form stuff through ajax...I would just do that, but I don't have time. Thanks everyone...

PS: I'll work on my coding style. :)

Bri
Or you could find out why it's blocking the query from running and fix it ;)
Leigh