Jump to content

George43

Caspio Ninja
  • Posts

    37
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by George43

  1. Code for Copy to clipboard In order to work this code you should replace [@field:ID#] with your unigue ID column field. Field [@field:Sub_Cat] replace with desired filed to copy. Place this code in HTML block of every row of the tabular report Data Page. <input id="in[@field:ID#]" style="width:1px; opacity:0;" > <button id="bt[@field:ID#]" type="button">Copy to Clipboard</button> <script type="text/javascript"> document.getElementById('bt[@field:ID#]').addEventListener("click", function(){ document.getElementById('in[@field:ID#]').value="[@field:Sub_Cat]"; document.getElementById('in[@field:ID#]').select(); document.execCommand("copy"); }); </script>
  2. You want to use your logic of the code above in my implementation on inline edit Data Page?Am i right? What are your fields names? Could inspect them throw developer tools? First make sure that jquery is working propertly. Then you should embed your code in this event. <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { //do something }); </script> If it does not help i will make custom code on your requirements.
  3. This code is updated due to event Changes after implementation of Ajax and some changes. This method will work same On Submission Data Page and on the Details Data Page without any code changing Header Code <!-- Header code --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script src="./jquery.signaturepad.min.js"></script> <div id="cb_sign_wrapper_edit"> <!-- Header code end --> First Signature code <!-- HTML Block code after hidden field with label Signature (type 64000) and virtual hidden field (CB_Virtual1)--> <div class="sigPad"> <div class="sig sigWrapper"> <canvas class="pad" width="218" height="55" style="margin: 0px 0px 0px 100px; border-style: solid; border-width: 1px; border-color: #bbbbbb #dbdfe6 #e3e9ef #e2e3ea; -webkit-border-radius: 1px; -moz-border-radius: 1px; -o-border-radius: 1px; border-radius: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; background-color: #FFFFFF;"></canvas></br> <span style="margin: 0px 0px 0px 264px;"> <input type="reset" class="clearButton" value="Clear"> </span> <input type="hidden" name="output" class="output"> </div> </div> <!-- html block end --> Second Signature code <!-- HTML Block code right after hidden field with label Sales_Signature (type 64000) and virtual hidden field2 (CB_Virtual2) --> <div class="sigPad"> <div class="sig sigWrapper"> <canvas class="pad" width="218" height="55" style="margin: 0px 0px 0px 100px; border-style: solid; border-width: 1px; border-color: #bbbbbb #dbdfe6 #e3e9ef #e2e3ea; -webkit-border-radius: 1px; -moz-border-radius: 1px; -o-border-radius: 1px; border-radius: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; background-color: #FFFFFF;"></canvas></br> <span style="margin: 0px 0px 0px 264px;"> <input type="reset" class="clearButton" value="Clear"> </span> <input type="hidden" name="output" class="output"> </div> </div> <!-- html block end --> Footer Code <!-- Footer code In order to work propertly Fields names: Signature/Sales_Signature After each should be html block--> <script type="text/javascript"> $(document).ready( function () { // TODO: Add your signature fields here in the order they appear on the form --> var signatureFields = [ ['Signature', [@field:Signature!], 'cbParamVirtual1'], ['Sales_Signature', [@field:Sales_Signature!], 'cbParamVirtual2'], ]; for (var i = 0; i < signatureFields.length; i++) { var api = $($('#cb_sign_wrapper_edit .sigPad')[i]).signaturePad({ drawOnly: true }); if (api) { api.regenerate(signatureFields[i][1]); } } document.addEventListener('BeforeFormSubmit', function(event) { for (var i = 0; i < signatureFields.length; i++) { // Dump signature JSON data into hidden signature field var newSignature = $('#cb_sign_wrapper_edit .output')[i].value; if( $('#EditRecord' + signatureFields[i][0])[0]){ $('#EditRecord' + signatureFields[i][0])[0].value = newSignature; } if( $('#InsertRecord' + signatureFields[i][0])[0]){ $('#InsertRecord' + signatureFields[i][0])[0].value = newSignature; } // Capture each signature image into its corresponding [hidden] VIRTUAL field var api = $($('#cb_sign_wrapper_edit .sigPad')[i]).signaturePad({ drawOnly: true }); if (api) { api.regenerate(newSignature); $('#' + signatureFields[i][2]).val(api.getSignatureImage()); } } }); } ); </script> </div> <!-- Footer code end --> This code requires jQuery signature library file in the root of the page on your hosting. File with Library and Example of the app is attached below. jquery.signaturepad.min.js Multiple_Signatures_1_0_2019-Feb-14_1224.zip
  4. In order achieve this functionality you could use this code. <script> var nameOfField = "InlineEditEmail"; document.addEventListener('DOMSubtreeModified', function(){ if(document.getElementsByName(nameOfField)[0]){ document.getElementsByName(nameOfField)[0].addEventListener('change', function(){ var cash= document.getElementsByName(nameOfField)[0].value; if(isNaN(cash)) { alert("You have entered an invalid value in the Enter Cash Deposit field. Value must be numeric. Do not include letters or symbols."); document.getElementsByName(nameOfField)[0].value=""; document.getElementsByName(nameOfField)[0].focus(); } else if((cash) < 0) { alert("You have entered an invalid value in the Enter Cash Deposit field. Value cannot be a negative amount."); document.getElementsByName(nameOfField)[0].value=""; document.getElementsByName(nameOfField)[0].focus(); } }); } }); </script> <!-- Ps this field is named as it called in your case, to find out it you should open inspect tool -->
  5. This solution is for hiding Inline edit elements for certain conditions on Report Data Page. For Hiding element with "Comment" label if value in dropdown with "Approved" label is not equal "Not Approved" If need can applied more complex conditions by modifying If Statemets. <script type="text/javascript"> document.addEventListener('DOMSubtreeModified', function(){ var InlineEditApproved=document.getElementsByName("InlineEditApproved")[0]; var InlineEditComment=document.getElementsByName("InlineEditComment")[0]; if(InlineEditApproved && InlineEditComment){ if(InlineEditApproved.value!="Not Approved"){ InlineEditComment.style.display="none"; } InlineEditApproved.addEventListener('change', function(){ if (InlineEditApproved.value=="Not Approved"){ InlineEditComment.style.display="block"; } else{ InlineEditComment.style.display="none"; } }); }else{ return false; } }); </script> Info: InlineEditApproved-InlineEdit+(Name of dropdown) InlineEditComment-InlineEdit+(Name of comment label) Not Approved-Condition of dropdown element can be modified
  6. Unfortionally it is now possible with standard features, when you try implement multiselect with listbox is rules is going crazy.
  7. In order to do this you can just use this simple snippet of code. document.getElementsByClassName("cbResultSetCalendarField")[x].style.backgroundColor="blue"; Where x is Number of Day of the monthe starting from 0
  8. Have implemented Rules behavior on JavaScript for Our Medical Project.Main challenge was to create Rules behavior on a virtual cascading list box element with a pre-selected values.Main workflow is.1)You type or 1 or 2 In conditions2)Script will automatically select all elements in 100ms3) IF in listbox value 1 is selected first 3 elements will show4) IF in listbox value 2 is selected others 3 elements will show App is attached MultiSelect_With_sections_1_0_2019-Jan-31_1219.zip
  9. I had this case and I just used single update form as Data Page. I Used "NumberNormal" as column name i should to convert. Added another column with name HexNum. After that i added simple HTML block in the bottom of Update Data Page and put this snippet of code. <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var normal = Number(document.querySelector("#EditRecordNumberNormal").value); hexString = normal.toString(16); if (hexString.length % 2) { hexString = '0' + hexString; } document.querySelector("#EditRecordHexNum").value = hexString; }); </script>
  10. @samliu6339 Could you provide with more details on your workflow? Which timezone admin located? What type of field Order_Time? Is it Date/Time? Which style format user should see? If I understand you correctly Example: Timestamp Now is 1.17.2019 1 am (UTC) user is in GMT+3 and it has 4 am 1.17.2019 now. In the table, it should go result 4am 1.17.2019 as if it was in UTC zone. When we will display the result for this user we will show 4 am 1.17.2019. Is it correct?
  11. Sometime ago a used this kind of formula to parse large amounts of users FullName info First Name: IsNull(Left([@field:FullName],(Patindex('%,%', [@field:FullName])-1)),' ') Last Name: IsNull(Right([@field:FullName],( Len([@field:FullName])-Patindex('%,%', [@field:FullName]))),' ') Formula for Parsing Values formCollumn: FullName
  12. Hi i used to do this last week ago. I used formula field in data page CASE WHEN [@field:Gender] = 'Male' THEN '<a href="https://google.com">Link</a>' END
×
×
  • Create New...