Jump to content

Modifying The Update Button


Recommended Posts

You can recreate the update button and add the functionality.

 

First, add a Header/Footer in "Configure Details Page Fields". Add the following to the Header (make sure to click "Source" in the editor)



<style type="text/css">
#Mod0EditRecord{
      display: none;
     }
</style>


 

This hides the default "Update button".

 

Next, add an HTML Block then add the following code:

 



<input class="cbUpdateButton" id="Mod0EditRecord1" name="Mod0EditRecord" onclick="updateRecord()" onmouseout="cbButtonHover(this,'cbUpdateButton');" onmouseover="cbButtonHover(this,'cbUpdateButton_hover');" type="submit" value="Update" />


This adds the modified "Update" button. Note the "onlick" attribute in the element. This calls the updateRecord() function which adds functionality to an otherwise default "Update" button. 

 

On the same HTML block, add the following code:



<script>
function updateRecord(){
   document.getElementById("EditRecordFIELD_NAME").value = "VALUE";
}
</script>


 

Change the FIELD_NAME to the name of the field that your want to be updated when the button is clicked. Change VALUE to whatever you want the field to have after clicking the modified "Update" button. For more information about referencing Caspio Form Elements, click here

Link to comment
Share on other sites

  • 1 year later...

Good Morning, 

I'm attempting to close a search and report after a bulk edit is processed. Per the F12 developer tool the button element is as follows: 

<input class="SimpleButton ActionButton" type="button" value="Update" style="max-width: 720.5px;">

I'm unable to use the emails and destinations page since this is a bulk edit. Is there a way to modify the above code for bulk edit window closure? My attempts to create a new button have lost the bulk edits altogether. 

Currently, I'm using criteria on the bulk edit's search and report (Does not contain "False") along with a localization script to perform a crude window closure and page refresh which is working.

The issue is that since the bulk edit sets the false criteria it's filtered out of the bulk edit's report indefinitely unless the user makes a change to the record which might not happen. My goal is to keep all records together no matter the rate updates. My process is below. 

Method currently being used is as follows: 

I'm using a (Rate Update)search and report with bulk edit to update rates in many records. The user decides the records that require updates. All of these records have the same Invoice ID (unique ID).

I'm then using a pop-up window link to a 2nd search and report (Payment Details) on the 1st search and report (Rates). The link automatically selects all records with the same Invoice ID on the 2nd search and report and opens the bulk edit for that report. The user can only view the bulk edit box (set at 100% of the 2nd data page height and width). I added this control to ensure that the user selects all records associated with the Invoice ID to add the updated invoice's payment details (pay date/check no/etc.). This way even if updates were not made to the rates of each record the records will always stay together on each updated invoice. 

Once the 2nd search and report's (Payment Details) bulk edit is complete it assigns "false" to each of the automatically selected records that share the same Invoice ID. The Payment Details search and report filters out the "false" text and defers to the "No records" script that I"ve placed in the localization for Payment Details. 

The above works well the first time around. Every time thereafter it does not work. This is because the record would have to be selected in the 1st (Rate) search and report to have "True" added back to the record so that it will not filter out of the 2nd (Payment Detail) bulk edit. I cannot rely on the user to select each record. Select ALL can't be used because the rates are different for each record. 

What I'd like to happen is for the bulk edit window (Payment Details) and the it's search and report to close after the update button is clicked in the bulk edit. Currently, without the above steps the window just stays open and the report can be viewed; the 1st datapage will not refresh with the latest updates.  

I appreciate any assistance that can be provided. 

Thank you!

Bre

 

 

 

Link to comment
Share on other sites

  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...