Volomeister Posted November 4, 2022 Report Share Posted November 4, 2022 I have a tabular report with inline add and edit options enabled. Due to the logic of my application, I cannot accept 0 (zero) as a value in one of number inputs. To restrict adding 0 while adding new or editing existing values in tabular report, I used the following script: <script> if(typeof enforceNoZeroInput == 'undefined') { const inputAddName = 'InlineAddInteger_1' const inputEditName = 'InlineEditInteger_1' const enforceNoZeroInput = () => { document.addEventListener('input', (e)=>{ if (e.target.getAttribute('name').indexOf(inputAddName) > -1 || e.target.getAttribute('name').indexOf(inputEditName) > -1) { if (e.target.value == '0' ) { e.target.value = '' alert('zero value is forbidden') }}}, true) document.removeEventListener('DataPageReady', enforceNoZeroInput )} document.addEventListener('DataPageReady', enforceNoZeroInput ) } </script> Where "InlineAddInteger_1" is the name of the input in inline add section of tabular report where 0 is not allowed And "InlineEditInteger_1" is the name of the input in inline edit section of tabular report where 0 is not allowed You can find names of your inputs in the source code when inspecting them in your browser 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.