EasyCFM.COM ColdFusion Forums / Coding Help! / Form not updating.

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Form not updating.

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

tati2001
12-29-2012 @ 1:15 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Member
Posts:
Joined: Dec 2012

i have file called: pcm_UpdateNewcategory.cfm
with following code:

<p> </p>
<p> </p>
<CFQUERY NAME="LoadNewsCategories" Datasource="#dbase#" dbtype="odbc">
SELECT *
FROM news_categories
WHERE news_categoryID = #URL.news_categoryID#
</CFQUERY>
<table align="center" id="rounded-corner" summary="2007 Major IT Companies' Profit">
    <thead>
         <tr>
         <CFForm action="pcm_UpdateNewCategory_Action.cfm" method="post">
        <!--- <cfoutput query="CurrAdmin"><cfinput name="administrator_id" type="hidden" value="#administrator_id#"></td></tr></cfoutput>--->
             <CFOUTPUT QUERY="LoadNewsCategories">
            <th scope="col" class="rounded-company"></th>
            <th scope="col" class="rounded">Update New Category</th>
          
        </tr>
    </thead>
        <tfoot>
         <tr>
             <td colspan="6" align="center" valign="top" class="rounded-foot-left"><em>Brieft:<br>
                <textarea name="news_categorybrief" cols="70" rows="10" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-SIZE: 12px; BORDER-LEFT: 1px solid; COLOR: black; BORDER-BOTTOM: 1px solid"></textarea>
             </em></td>
             <td class="rounded-foot-right"> </td>

        </tr>
         <tr>
           <td colspan="6" align="center" class="rounded-foot-left"><input type="Submit" value="Add" class="button" onClick="return confirm('Are You Sure You Want To Add This Record?')">
             </input>
            <input type="submit" value="Edit" name="btnEdit2" id="btnEdit2">
          </input></td>
           <td class="rounded-foot-right"> </td>
         </tr>
    </tfoot>
    <tbody>
         <tr>
           <td> </td>
           <td colspan="6"> </td>
          </tr>
         <tr>
             <td> </td>
            <td>Name : </td>
            <td><cfinput type="text" name="news_categoryname"id="txtName2" size="20" required="yes" message="Add A Category" /></td>
            <td>Show Index</td>
            <td><select name="news_categoryindexed">
              <option><?php echo ""; ?></option>
              <option>Yes</option>
              <option>No</option>
            </select></td>

            <td> </td>
            <td> </td>
        </tr>
        
         <tr>
             <td> </td>
            <td>Banner :</td>
            <td><cfinput type="text" name="news_categorybanner" value="spacer.gif" /></td>
            <td>Feature</td>
            <td><select name="cboFeature2" id="cboFeature2" disabled>
              <option><?php echo ""; ?></option>
              <option>Yes</option>
              <option>No</option>
            </select></td>

            <td> </td>
            <td> </td>
        </tr>
        
         <tr>
             <td> </td>
            <td>Advert :</td>
            <td><cfinput type="text" name="news_categoryadvertimg" value="spacer.gif" /></td>
            <td>Display</td>
            <td><select name="news_categoryshow">
              <option>Yes</option>
              <option>No</option>
            </select></td>

            <td> </td>
            <td> </td>
        </tr>
        
         <tr>
             <td> </td>
            <td>Thumb :</td>
            <td><cfinput type="text" name="news_categorythumbnail" value="spacer.gif"></td>
            <td><label>Position</label></td>
            <td><select name="news_categoryposition">
              <option>Top</option>
              <option>Bottom</option>
              <option>Center</option>
              <option>Left</option>
              <option>Right</option>
            </select></td>

            <td> </td>
            <td> </td>
        </tr>  
         <tr>
        
             <td> </td>
            <td>keyword</td>
            <td><cfinput type="Text" name="news_mettakeywords" />
              <cfinput name="news_dateadded" type="hidden" value="#DateFormat(todayDate, "yyyy-mm-dd")#">
            <cfinput type="hidden" name="news_categorydownloadTitle" value="N/A"></td>
            <td>Download</td>
            <td><select name="news_categorydownloadtype" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-SIZE: 9px; BORDER-LEFT: 1px solid; COLOR: 666666; BORDER-BOTTOM: 1px solid">
              <option value="spacer.gif" selected="selected">No</option>
              <option value="ms_word.jpg">Word</option>
              <option value="ms_pdf.jpg">PDF</option>
              <option value="ms_excel.jpg">Excel</option>
              <option value="ms_powerpoint.jpg">PPT</option>
            </select>
              <cfoutput>
                <cfinput type="Text" name="news_categorydownload" value="If Yes Filename" size="15" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-SIZE: 9px; BORDER-LEFT: 1px solid; COLOR: black; BORDER-BOTTOM: 1px solid">
            </cfoutput></td>

            <td> </td>
            <td> </td>
        </tr>
        
         <tr>
             <td> </td>
            <td>Phrases</td>
            <td><cfinput type="Text" name="news_mettakeyphrases"></td>
            <td>Order:</td>
            <td><cfinput type="Text" name="news_categoryOrder" value="0" /></td>

            <td> </td>
            <td> </td>
        </tr>    
        
    </tbody>
           </CFOUTPUT>
    </CFForm>
</table>
</div>


-----------------------------------------
other file here:
pcm_UpdateNewCategory_Action.cfm
<!--- Update the New Category, and write the new data to the database --->
<CFQUERY name="Add_CADCorp_Category" datasource="#dbase#" dbtype="ODBC">

UPDATE news_categories
SET
FirstName = <cfqueryparam value="#Form.FirstName#" cfsqltype="cf_sql_varchar">,
news_categoryname = <cfqueryparam value='#form.news_categoryname#'cfsqltype="cf_sql_varchar">,
news_categorythumbnail = <cfqueryparam value='#form.news_categorythumbnail#'cfsqltype="cf_sql_varchar">,
news_categorybanner =<cfqueryparam value= '#form.news_categorybanner#'cfsqltype="cf_sql_varchar">,
news_categoryposition = <cfqueryparam value='#form.news_categoryposition#'cfsqltype="cf_sql_varchar">,
news_categoryshow = <cfqueryparam value='#form.news_categoryshow#'cfsqltype="cf_sql_varchar">,
news_categoryindexed =<cfqueryparam value= '#form.news_categoryindexed#'cfsqltype="cf_sql_varchar">,
news_categoryOrder =<cfqueryparam value= #form.news_categoryOrder#cfsqltype="cf_sql_varchar">,
news_categorybrief = <cfqueryparam value='#form.news_categorybrief#'cfsqltype="cf_sql_varchar">,
news_categoryadvertimg = <cfqueryparam value='#form.news_categoryadvertimg#'cfsqltype="cf_sql_varchar">,
news_categorydownload = <cfqueryparam value='#form.news_categorydownload#'cfsqltype="cf_sql_varchar">,
news_categorydownloadtype = <cfqueryparam value='#form.news_categorydownloadtype#'cfsqltype="cf_sql_varchar">,
news_categorydownloadTitle = <cfqueryparam value='#form.news_categorydownloadTitle#'cfsqltype="cf_sql_varchar">,
news_mettakeywords = <cfqueryparam value='#form.news_mettakeywords#'cfsqltype="cf_sql_varchar">,
news_mettakeyphrases = <cfqueryparam value='#form.news_mettakeyphrases#'cfsqltype="cf_sql_varchar">,
WHERE news_categoryID =<cfqueryparam value= #form.news_categoryID#cfsqltype="cf_sql_varchar">
</CFQUERY>
<CFLOCATION URL="index.cfm?administrator_id=#form.administrator_id#">





the First file when i run i got error and information is not showing on screen.


        

dlackey
12-31-2012 @ 2:12 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 935
Joined: Jun 2007

Without an error message, we cannot begin to help you.  There are too many unknown variables, database, form field could be misspelled... lots to check.

My knee jerk reaction would be to cfparam your variables on the action page.

Cheers,
Chip


Website Designed and Developed by Pablo Varando.