beryllium Posted June 16, 2022 Report Share Posted June 16, 2022 I have an Update page where I want to disallow users from updating the form when the CurrentProcess != 00 or 05 I have the following script placed in the footer, it works when there is only one condition [("[@field:CurrentProcess]" != "00")] but does not work when I include [|| ("[@field:CurrentProcess]" != "05")]. Is there anything wrong with the script? Thanks! <script> document.addEventListener('DataPageReady', function (event) { if (("[@field:CurrentProcess]" != "00") || ("[@field:CurrentProcess]" != "05")) { document.getElementsByName("Mod0EditRecord").forEach(function(elem) { elem.style.display= 'none'; }); } }); </script> Quote Link to comment Share on other sites More sharing options...
PotatoMato Posted June 16, 2022 Report Share Posted June 16, 2022 Hi @beryllium, you may check this forum post for reference: Quote Link to comment Share on other sites More sharing options...
BaySunshine Posted June 16, 2022 Report Share Posted June 16, 2022 Hi @beryllium, A standard way of achieving this without using JavaScript is below: Add a Header/Footer to your page. Enter following code to hide the existing Update button: <style> .cbUpdateButton { display: none !important; } </style> Add a new section and in it add an HTML Block. Enter following code to add a custom Update button: <div id="update" align="center"> <input type="submit" class="cbSubmitButton" value="Update" /> </div> Now add a Rule. It should look like below: Replace "Value" with your field name. I hope this helps. Regards, GrumpyRick and Lepidoptera 1 1 Quote Link to comment Share on other sites More sharing options...
GrumpyRick Posted September 18, 2022 Report Share Posted September 18, 2022 Excellent option. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.