Henco Posted January 24, 2019 Report Share Posted January 24, 2019 I am trying to create an html block with custom JS code that converts my Record Count Field into a hexadecimal value. Eg. RecordCount = 1000, then convert to Hex = 3E8. I need this value to be displayed. Can someone please assist me with some code? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted January 24, 2019 Report Share Posted January 24, 2019 If you are on a submission DataPage and you have an input for the number with the field name: "NumberValue" and another field where you want to store "Hex" you can use the code below in the footer <div id=d1></div> <script language='JavaScript' type='text/JavaScript'> <!-- document.getElementsByName("Submit")[0].onmouseover = function (){ var n1=document.getElementById("InsertRecordNumberValue").value; if(isNaN(n1)){ document.getElementById("d1").innerHTML=document.getElementById('t1').value + " is not a number "; }else{ n1=parseInt(n1); var h = document.getElementById("InsertRecordHex").value =n1.toString(16); // Change the toString(16) to toString(8) or toString(2) get Octal and binary conversion } } //--> </script> on Details or update page as long as the form element is not "display only" and "cascading" you can change "InsertRecord" to "EditRecord" in the code above. Henco 1 Quote Link to comment Share on other sites More sharing options...
Henco Posted February 1, 2019 Author Report Share Posted February 1, 2019 Works great! 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.