Skip to main content
MusicManMD
Known Participant
May 13, 2010
Question

update cfform

  • May 13, 2010
  • 1 reply
  • 396 views

I have a cfgrid that when a single record is clicked, populates another basic cfform so the user can update various fields not in the grid. However, I cannot get the ColdFusion.AJAX.submitForm to work. The binding from the grid works fine. Here is the code I have:


<script type="text/javascript">

    function submitFrm() {
          alert("I clicked the button!");   //Test
        ColdFusion.Ajax.submitForm('editForm', 'admin/mtfUpdate.cfm', callback, errorHandler);
    }
   
    function callback()
    {
        alert("Successfully Updated");
          ColdFusion.Grid.refresh('mtfRequire', true);
    }
   
    function errorHandler(code, msg)
    {
        alert("Error!!! " + code + ": " + msg);
    }
</script>

<cfform name="editForm">
<cfinput type="text" bind="{mtfRequire.sixmonths_thru_35months_8}" name="sixmonths_thru_35months_8" class="MTFEdit" size="5">

<cfinput type="button" name="submit" id="submit" onclick="javascript:submitFrm();" value="Update Requirements" class="helptext" />
    This topic has been closed for replies.

    1 reply

    Inspiring
    May 24, 2010

    Add this at the top of the page (the one with the cfform):

    <cfajaximport />