Link to home
Start Free TrialLog in
Avatar of atwork2003
atwork2003

asked on

JAVA script code Modification

Hi
I am trying to display the result set that I get back from this code to be displayed in an Alert Box Instead of a Table which it was previously doing. Can some one please modify this code so I can do that.
Thank you


function getColumnValues(){
  getElement('filterValueList').options.length = 0;
  var oid = getElement('currentViewId').value;
  var ot = getElement('objectName').innerHTML;
  var soid = getElement('filterColumns').value.split(/[\.:]/)[0];
  if (soid == null || soid == '') {
   
    return;
  }
  var filter = 'ot=' + ot + '&ua=Values&oid=' + oid + '&soid=' + soid;
  document.finishLoading = finishGetFilterColumnValues;
  loadDynamicData(filter);
}

function finishGetFilterColumnValues(responseDoc,generatedValues){
  document.finishLoading = null;
  if (document.getElementById('confirmationMessage').value == '1') {
    var soid = responseDoc.location.href.match(/soid=([^&#]*)/i)[1];
    var currentSoid = getElement('filterColumns').value.split(/[\.:]/)[0];
    if(soid != currentSoid)
      return;
    savedColumnValues[soid] = generatedValues;
    addSelectOptions(getElement('filterValueList'),generatedValues,false,false);
  }
}
ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atwork2003
atwork2003

ASKER

on click of a button a table is filled with values from a table in the database. so this dataloader is getting values from the database to be loaded in that table. these are the filter values that are related to the column values selected.
Thanks
The solution u gave me is not working can u please let me know another way of doing this. Also the script after" Return" actually display the result of the code. So if you can some how change it to display the result in alert box that will be really nice.

Thank you
When you say "table", are you talking about an HTML table?
Or a database table?
Or something else (like a javascript array)?

In order for the code above to work, the data is expected to
be in an array.  For example:
----------------------------------------------------------------------
<html>
<head>
<title>DisplayArray example</title>
</head>
<body>
<script type="text/javascript">
  function DisplayArray( name, data ) {
    var result = name + "[", comma = "";
    for ( var i = 0; i < data.length; ++i ) {
      result += comma + data[ i ];
      comma = ", ";
    }
    alert( result + "]" );
  }

  var info = [ 1, 2, 3, 4, 5 ];
  DisplayArray( "info", info );
</script>
</body>
</html>