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('filterValueLis t').option s.length = 0;
var oid = getElement('currentViewId' ).value;
var ot = getElement('objectName').i nnerHTML;
var soid = getElement('filterColumns' ).value.sp lit(/[\.:] /)[0];
if (soid == null || soid == '') {
return;
}
var filter = 'ot=' + ot + '&ua=Values&oid=' + oid + '&soid=' + soid;
document.finishLoading = finishGetFilterColumnValue s;
loadDynamicData(filter);
}
function finishGetFilterColumnValue s(response Doc,genera tedValues) {
document.finishLoading = null;
if (document.getElementById(' confirmati onMessage' ).value == '1') {
var soid = responseDoc.location.href. match(/soi d=([^&#]*) /i)[1];
var currentSoid = getElement('filterColumns' ).value.sp lit(/[\.:] /)[0];
if(soid != currentSoid)
return;
savedColumnValues[soid] = generatedValues;
addSelectOptions(getElemen t('filterV alueList') ,generated Values,fal se,false);
}
}
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('filterValueLis
var oid = getElement('currentViewId'
var ot = getElement('objectName').i
var soid = getElement('filterColumns'
if (soid == null || soid == '') {
return;
}
var filter = 'ot=' + ot + '&ua=Values&oid=' + oid + '&soid=' + soid;
document.finishLoading = finishGetFilterColumnValue
loadDynamicData(filter);
}
function finishGetFilterColumnValue
document.finishLoading = null;
if (document.getElementById('
var soid = responseDoc.location.href.
var currentSoid = getElement('filterColumns'
if(soid != currentSoid)
return;
savedColumnValues[soid] = generatedValues;
addSelectOptions(getElemen
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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>
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>
ASKER
Thanks