Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Submit Button Code Won't Save Like It Should

AmyJoJarboe
Contributor III

Hello! I recently decided to add a submit button to a questionnaire and am now having some issues. It is supposed to change a value and then save & close the file. However, it says "Saving..." and then says "There are unsaved changes do you still want to close the file?" Instead of just saving and closing like it did in the past. What's wrong with the way I'm doing it? Here is the code:

<div class="toolbar-app-buttons-left">
     <a title="Set Value" class="tb-btn-link-left" id="btnSetValue" href="javascript:void(0);" data-check-dirty="false">
          <div class="tb-btn" data-icon="&#xE348" data-icon-pos="left">Submit</div>
     </a>
</div>

<script type="text/javascript">
     var integration = {
          statusFieldId:"<correct ID is here>",
          statusSubmit:"<correct ID is here>"
     };

     $('#btnSetValue').click(function(){
        UpdatesValueList(integration.statusFieldId, integration.statusSubmit);
  ShowAnimationAndPostback('master$btnSave')
     });

     function UpdatesValueList(changeId, assignedValue) {
        var valueArray = new Array(1);
        valueArray[0] = assignedValue;
        $CM.setFieldValue(changeId, valueArray, '');
     }
 </script>
11 REPLIES 11

Anytime

A little change to this code but can't execute on 6.7, any thoughts?