Jump to content

Hide Button Based On Calculated Field


Recommended Posts

Intended action: Report form > Details area > HTML Block > Hide Submit button based on calculated fields

 

Reasoning: Based on the calculated field I want to allow or not allow the user to submit data from the details form.

 

 

Button does not hide, why?

 

 

<script language="javascript">
var stat='[@calcfield:1]';
if (stat.length>0)
{
  coauthor = stat;
  document.write(stat);
  document.getElementById("Submit").style.display = "none";
}
</script>
 
Possible solution?
Should I have this on exit of the Results page instead?

 

Link to comment
Share on other sites

  • 2 weeks later...

Good morning Mente,


 


How are you?


 


I think, you can use the Id of the Update button (Mod0EditRecord) instead of "Submit":



document.getElementById("Mod0EditRecord").style.display = "none";

And if you want to hide the button, it's better to place the code under the button - in the Footer of the DataPage.


You can add the Header&Footer element, select the "Footer" element, click the "Source" button, and enter your code.


 


Have a nice day!


Link to comment
Share on other sites

  • 4 weeks later...

Hello mente12

 

What do you meat " submit" on the details page?

 

 

Details page has two buttons - Update and Back 

 

If you want to hide an Update button , you can use the following script :

<SCRIPT LANGUAGE="JavaScript">

var stat='[@calcfield:1]';

if (stat.length>0)
    {
 
  document.getElementById("Mod0EditRecord").style.visibility = 'hidden';

    }



</script>

"stat.length" means length of symbols in the calculated field. If you want to use value of calculated field, delete the ".lenth" from the script.

 

I hope this helps

 

Aurora 

Link to comment
Share on other sites

  • 1 year 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...
 Share

×
×
  • Create New...