6 Replies Latest reply: Jan 18, 2012 11:21 AM by jeffsmth RSS

    Help!  Form is not submitting or doing anything! Any ideas?

    jeffsmth Community Member

      I inherited this web application and have zero CF experience and any help is greatly appreciated!  So, the "Forgot Password" form isn't working at all.  The email is sent properly from the referring page and when you click the link it brings up the page right, however, when you fill out the form with "email address" and "username" and hit submit, it does nothing.  I'm not even getting an error.

       

      Is there something I'm missing in the code that is wrong?  I'll post the entire code and what the URL looks like when arriving at this page.  It is still in my dev environment.

       

      Thanks in advance for ANY help!  I'm really lost and confused.

       

      http://<server>/~mld/ForgotPassword/index.cfm?plw=359&qke=995708

       

      <!---

      Project: MLD Registry

      Page Name: index.cfm

      Page Purpose: Home page for Forgot Password pages

      Programmer: Eric Savage

      --->

       

       

      <html>

      <head>

                <title>Forgot Password</title>

                <link rel="stylesheet" type="text/css" media="screen" href="../StyleSheet_Display.css" />

                <link rel="stylesheet" type="text/css" media="print" href="../StyleSheet_Print.css" />

      </head>

       

       

      <body>

      <cfsilent>

      <cfparam name="plw" default=""><!--- Registry_ID --->

      <cfparam name="qke" default=""><!--- Acct_num_temp --->

      <cfparam name="Email" default="">

      <cfparam name="UserName" default=""><!--- User Name --->

      <cfparam name="CheckEntries" default=""><!--- Check submissions for errors --->

      <cfparam name="Error" default="0">

      <cfparam name="ErrorMessage_Email" default="">

      <cfparam name="ErrorMessage_UserName" default="">

      <cfparam name="ksr" default=""><!--- Forgot password: email/new password sent --->

      <cfparam name="uca" default="">

       

       

      <cfif Len(CheckEntries) and Len(UserName) and Len(Email) and Len(plw) and Len(qke)>

                <cftry>

          <cfquery name="CheckIfValidUser" datasource="#Datasource#">

              SELECT                    rid,rid_name,r_email,registry_id,acct_num_temp,r_website_type

              FROM                    registry

              WHERE                    rid_name= <cfqueryparam value="#UserName#" cfsqltype="CF_SQL_VARCHAR"> and r_email= <cfqueryparam value="#Email#" cfsqltype="CF_SQL_VARCHAR"> and registry_id= #plw# and acct_num_temp= #qke#

          </cfquery>

          <cfcatch type="Any">

                          <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                    <cflocation url="ErrorMessage.cfm" addtoken="No">

              <cfabort>

          </cfcatch>

                </cftry>

       

       

                <cfif not CheckIfValidUser.RecordCount>

                          <cftry>

                          <cfquery name="UserLog" datasource="#Datasource#">

                                    INSERT INTO userlog(http_user_agent,todaysdate,ip_address,user_name,comments)

                                    VALUES ('#CGI.http_user_agent#',#CreateODBCDateTime(Now())#,'#remote_addr#','#Email#','ForgotPas sword/index.cfm: failed attempt')

                          </cfquery>

                          <cfcatch type="Any">

                                    <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                          </cfcatch>

                          </cftry>

                </cfif>

       

       

                <cfif CheckIfValidUser.RecordCount>

                          <cfinclude template="../includefiles/inc_Password_CreateRandom.cfm"><!--- Creates random password in variable called RandomlyCreated_Password --->

             

              <cfset Password_To_Check= RandomlyCreated_Password><!--- Pass value of new password to include file --->

                          <cfinclude template="../includefiles/inc_Password_CheckFormat.cfm"><!--- Check password complies with  --->

                          <cfif Len(ErrorMessage_Password_To_Check)>

                        <cfset ErrorMessage= "(" & #CheckIfValidUser.rid# & ") [auto password gen] " &  ErrorMessage_Password_To_Check>

                  <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                  <cflocation url="ErrorMessage.cfm" addtoken="No">

                  <cfabort>

                          </cfif>

             

                          <cfif not Len(ErrorMessage_Password_To_Check)>

                  <cftry>

                  <cfquery name="UpdatePassword" datasource="#Datasource#">

                      UPDATE                    registry

                      SET                              rid_pass= Password('#RandomlyCreated_Password#')

                      WHERE                    rid_name= <cfqueryparam value="#UserName#" cfsqltype="CF_SQL_VARCHAR"> and r_email= <cfqueryparam value="#Email#" cfsqltype="CF_SQL_VARCHAR"> and registry_id= #plw# and acct_num_temp= #qke#

                  </cfquery>

                  <cfcatch type="Any">

                      <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                      <cflocation url="ErrorMessage.cfm" addtoken="No">

                      <cfabort>

                  </cfcatch>

                  </cftry>

       

       

                  <cftry>

                  <cfquery name="UserLog" datasource="#Datasource#">

                      INSERT INTO userlog(http_user_agent,todaysdate,ip_address,user,comments)

                      VALUES ('#CGI.http_user_agent#',#CreateODBCDateTime(Now())#,'#remote_addr#','#CheckIfValidUser.r id#','ForgotPassword/index.cfm: new password added')

                  </cfquery>

                  <cfcatch type="Any">

                      <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                  </cfcatch>

                  </cftry>

       

       

                  <cfparam name="Subject" default="(Secure) NDRD Clinical Questionnaire">

                  <cfif CheckIfValidUser.r_website_type is "MLD"><cfset Subject= "(Secure) MLD Registry"></cfif>

                  <cfif CheckIfValidUser.r_website_type is "NFRD"><cfset Subject= "(Secure) NFRD Registry for Rare Genetic Disorders"></cfif>

                  <cftry>

                  <cfmail

                      to="#Email#"

                      subject="#Subject#"

                      from="#CONTACT.EMAIL_NURSE#"

                      server="<SMTP SERVER>"

                      type="html">

                      <p>Here is the new password you requested: #RandomlyCreated_Password#.</p>

                  </cfmail>

                  <cfcatch type="Any">

                      <cfinclude template="../includefiles/inc_EmailWebsiteManager.cfm">

                      <cflocation url="ErrorMessage.cfm" addtoken="No">

                      <cfabort>

                  </cfcatch>

                  </cftry>

                 

                  <cfparam name="WebsiteType" default="">

                  <cfif CheckIfValidUser.r_website_type is "Clinic"><cfset WebsiteType= "01345"></cfif>

                  <cfif CheckIfValidUser.r_website_type is "MLD"><cfset WebsiteType= "04385"></cfif>

                  <cfif CheckIfValidUser.r_website_type is "NFRD"><cfset WebsiteType= "03475"></cfif>

         

                  <cflocation url="index.cfm?ksr=30471&dfa=84836&uca=#WebsiteType#" addtoken="No">

              </cfif>

                </cfif>

      </cfif>

      </cfsilent>

       

       

      <cfinclude template="inc_PageTitle.cfm"><!--- Page title --->

      <div id="Container">

                <cfinclude template="inc_NavBar.cfm">

                <div id="Content">

                          <div id="minheight">

                                    <cfoutput>

                                    <cfif not Len(ksr)>

                                              <div style="padding: .5em 0 .75em 0; border-style: solid; border-width: 0 0 1px 0;">

                          Please enter your email address and user name.

                                              </div>

                                              <cfform action="index.cfm" method="POST">

                                                        <p>

                                                        <span class="ResponseLabel_10"><label for="Email">Email Address</label></span>

                                                        <cfinput type="Text" name="Email" id="Email" value="#Email#" message="Please enter an email address" required="Yes" size="30" maxlength="40">

                                                        </p>

                                                        <p>

                                                        <span class="ResponseLabel_10">User Name</span>

                                                        <cfinput type="Text" name="UserName" id="UserName" value="#UserName#" message="Please enter a User Name" required="Yes" size="12" maxlength="50">

                                                        </p>

                                                        <p><input type="submit" value="Submit"></p>

                                                        <input type="hidden" name="CheckEntries" value="Check">

                          <cfoutput>

                                                        <input type="hidden" name="plw" value="#plw#"><!--- Registry_ID --->

                                                         <input type="hidden" name="qke" value="#qke#"><!--- Acct_num_temp --->

                          </cfoutput>

                                              </cfform>

                                    </cfif>

                                    <cfif Len(ksr)>

                                              <cfif Trim(uca) is "01345"><cfset WebsiteType= "Clinic"></cfif>

                      <cfif Trim(uca) is "04385"><cfset WebsiteType= "MLD"></cfif>

                      <cfif Trim(uca) is "03475"><cfset WebsiteType= "NFRD"></cfif>

                                              <div style="padding: .5em 0 .75em 0;">An email has been sent with your new password.</div>

                     

                      <cfif Len(Trim(WebsiteType))><a href="#HTMLPath#/#WebsiteType#/LogIn.cfm">Log in</a></cfif>

                                    </cfif>

                                    </cfoutput>

                          </div><!--- min-height --->

                </div><!--- Content --->

      </div><!--- Containter --->

      <cfinclude template="../includefiles/inc_PageFooter.cfm"><!--- Page footer (contains closing tag for Container) --->