2 Replies Latest reply on Jan 3, 2017 4:21 AM by Thorsten Fleischmann

    Get field value for javascript code

    Daniel Gomez
      Share:|

      Hello everyone,

       

      I've done a HTML-Javascript code that shows a graphic.

      I use a view field and a file attach into a template at "AR System Resource Definitions" form

       

      Into javascript code I need obtain a field integer value for use it into graph value.

       

      var name1 = '\$536870938$';
      var name2 = '\$536870939$';
      var name3 = '\$536870937$';
      var name4 = '\$536870940$';
      
      var value1 = '\$536870946$';
      var value2 = '\$536870947$';
      var value3 = '\$536870948$';
      var value4 = '\$536870949$';
      
      
      var value1 = document.getElementById('NameField_1');
      var value2 = document.getElementById('536870946');
      
      var barChartData = {
              labels : [name1,name2,name3,name4],
              datasets : [
                  {
                      fillColor : "#6b9dfa",
                      strokeColor : "#ffffff",
                      highlightFill: "#1864f2",
                      highlightStroke: "#ffffff",
                      data : [value1,value2,value3,value4]
                  },
                  {
                      fillColor : "#e9e225",
                      strokeColor : "#ffffff",
                      highlightFill : "#ee7f49",
                      highlightStroke : "#ffffff",
                      data : [1,1,1,1]
                  }
              ]
      
          }
      cument.getElementById('/$536870950$');
      

       

      I obtain the value of different ways, but it not work fine.

      When in the graph set a values for labels, it work fine

      var name1 = '\$536870938$';
      var name2 = '\$536870939$';
      var name3 = '\$536870937$';
      var name4 = '\$536870940$';
      
      labels : [name1,name2,name3,name4]
      
      labels : [name1,name2,name3,name4]
      

       

      But when I obtain the integer values for graph, it don't work fine.

       

      var value1 = '\$536870946$';
      var value2 = '\$536870947$';
      var value3 = '\$536870948$';
      var value4 = '\$536870949$';
      
      data : [value1,value2,value3,value4]
      
      lue4]
      

       

      I`ve obtain this values of different ways, but it not work fine.

      var value1 = document.getElementById('NameField_1');
      var value2 = document.getElementById('536870946');
      var value1 = '\$536870946$';
      
      

       

      In HTML code it show the value of field if I put $536870946$, and in javascript code only work fine when the javascript function needs a character value, but when it needs a integer value don't work.

       

      I have trying it with character and integer fields, but no.

       

      Are there other any way of obtain fields values of remedy form for javascript code?

       

      Thanks and Best Regards