Jump to content
  • 0

disable "UPDATE" button on Report Details page


vishal

Question

I have a datapage of type Report -> details.  The page receives a parameter for the record ID.  All the fields that I display to the user are configured as "Display only".  How do I disable/hide the "Update" button at the bottom of the screen since I want this to be "view only" with no other buttons on the page?  

I looked at the help section at http://howto.caspio.com/datapages/reports/creating-a-report-datapage/  

According to the instructions at the bottom of this page, " The next screen depends on the whether any field is editable. If at least one field is editable, destination options become available and they dictate where the user is directed to when they click the Update button on the details page. "

However, as I said above, all the fields on my  "Search and Report Wizard - Configure Details Page Fields are marked as "display only". yet I get the Update button. 

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
17 hours ago, vishal said:

I have a datapage of type Report -> details.  The page receives a parameter for the record ID.  All the fields that I display to the user are configured as "Display only".  How do I disable/hide the "Update" button at the bottom of the screen since I want this to be "view only" with no other buttons on the page?  

I looked at the help section at http://howto.caspio.com/datapages/reports/creating-a-report-datapage/  

According to the instructions at the bottom of this page, " The next screen depends on the whether any field is editable. If at least one field is editable, destination options become available and they dictate where the user is directed to when they click the Update button on the details page. "

However, as I said above, all the fields on my  "Search and Report Wizard - Configure Details Page Fields are marked as "display only". yet I get the Update button. 

 

Hi,

The update button appears only if you have at least one editable field on the datapage. Perhaps you hide that field using rules or javascript.

Anyway you can hide update button using java script. Just add header/footer and paste the following code in the footer:

<script>
window.onload = function hide(){
document.getElementById("Mod0EditRecord").style.visibility = 'hidden';
}
</script>
Link to comment
Share on other sites

  • 0

Hello,

how would I go about getting the script to run only if a field has a specific value?

 

I've tried this, but it doesn't work:

<script>
var checkvalue;
checkvalue=document.getElementById("Approved_by_CFA").value;
if (checkvalue == "Yes"){
function hide() {
document.getElementById("Mod0EditRecord").style.visibility = 'hidden';
}
}
</script>

 

I've also tried this

<script>
var checkvalue;
checkvalue=document.getElementById("Approved_by_CFA").value;
if (checkvalue == "Yes"){
document.getElementById("Mod0EditRecord").style.visibility = 'hidden';
}
</script>

 

Any help would be appreciated.

Thanks,
Julien

Link to comment
Share on other sites

  • 0
On 5/16/2017 at 1:52 PM, logistics said:

Hello,

how would I go about getting the script to run only if a field has a specific value?

 

I've tried this, but it doesn't work:

<script>
var checkvalue;
checkvalue=document.getElementById("Approved_by_CFA").value;
if (checkvalue == "Yes"){
function hide() {
document.getElementById("Mod0EditRecord").style.visibility = 'hidden';
}
}
</script>

 

I've also tried this

<script>
var checkvalue;
checkvalue=document.getElementById("Approved_by_CFA").value;
if (checkvalue == "Yes"){
document.getElementById("Mod0EditRecord").style.visibility = 'hidden';
}
</script>

 

Any help would be appreciated.

Thanks,
Julien

 

Hi Julien,

Did you put your script in Details datapage?

Please note that you use the wrong syntax to reference the field.

Quote

document.getElementById("Approved_by_CFA").value;

I would highly recommend looking at this Forum post:

https://forums.caspio.com/index.php?/topic/4377-js-guide-caspio-form-elements/

 

Link to comment
Share on other sites

  • 0

Hi there,

 

Yes, I put the script in the footer of the details page.

I'm sorry to be a pain, but could you tell me what is wrong with the syntax? 

I had read the post you mentioned, and that formed the basis of the scrip I wrote, in conjunction with this post.

I have very little knowledge of Javascript, so I'm not sure where I went wrong...

Many thanks,

Julien

Link to comment
Share on other sites

  • 0

I had the same stupid issue.  Just set the button in CSS to display:none!important

However, I guess someone could inspect the element and undo that..  You could also make the button a go back button so that when the record is "updated" data page returns somewhere

You could also make your details page a regular List view page which would not have the button.  Hope this helps

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