Jump to content
  • 0

Automatic update


BjornSkifs

Question

I have a report where some calculations are made in javascript in a HTML block on the details page and put into a field.

This means that when the user visits the details page, the calculations have been made and are shown, but not saved. The user has to click on "Update" for the calculations to be saved.

I have two questions:

1. Is there a way to automatically update the details page as soon as the user visits it?

2. Is there a way to update the details page when the user presses the "Back" button.

Any help would be greatly appreciated.

Thanks!

/Bjorn

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

1- You can have auto submit on your details page in the footer:

function f_submit() {

document.getElementById("caspioform").submit();

}

setTimeout("f_submit();",5000);

This code will auto submit the page after 5 seconds.

2- You can change the update button text to back in the localization your are using for this page in Setting screen, under Text >> Forms/Details pages >> Buttons.

Link to comment
Share on other sites

  • 0

Beautiful! Thanks MayMusic! :D:D:D

I went with the auto submit script. Wonderful piece of work!

I was unable to combine 1 & 2 consistently, though. 1. requires me to stay on the details page after an update, whereas 2. requires me to go to the results page after an update (camouflaged by a Back button).

I was also unable to suppress the original Back button under 2. I tried the following two alternatives

document.getElementById("Back").style.display = "none";
document.forms.caspioform.cbBackButton.style.visibility='hidden';
Neither of them worked. I'm problably just doing something silly here.

The auto submit script does a big part of the job, but if you, or anybody else, have a suggestion as to how I might make 2 consistent with 1, I would be really grateful.

Again, thanks for your help!

Bjorn

Link to comment
Share on other sites

  • 0

Are you trying to hide the button? You can do it in the style of the page. First Edit the style and check show advanced options CSS and go to setting screen. There under Forms/Details >> Buttons switch to advanced tab and find "..cbBackButton". In that class you can add "display:none;" to hide the button. :wink: :wink: :wink: :wink:

Link to comment
Share on other sites

  • 0

Excellent! Thanks again! :D

The auto update function is really useful! I would like to avoid the repeated updates though. I have a comment field on the page, and the repeated updates makes it difficult for the user to write comments properly.

Is there a way to update twice everytime the user click on Update, but then stop the automatic update?

Link to comment
Share on other sites

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
Answer this question...

×   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...