good morning , am doing a query builder and i need help regarding how to get fields and its values in a table i referred the the following example but i need dynamically all fields .Simple Find
<SPAN><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "</SPAN><A class="jive-link-external-small" href="http://www.w3.org/TR/html4/strict.dtd" rel="nofollow noopener noreferrer" target="_blank">http://www.w3.org/TR/html4/strict.dtd</A><SPAN>"></SPAN><BR /><html><BR /> <head><BR /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><BR /> <meta http-equiv="X-UA-Compatible" content="IE=7" /><BR /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples <BR /> on iOS devices--><BR /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/><BR /> <title>Simple Find</title><BR /><SPAN> <link rel="stylesheet" type="text/css" href="</SPAN><A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css" rel="nofollow noopener noreferrer" target="_blank">http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css</A><SPAN>"></SPAN><BR /><SPAN> <script type="text/javascript" src="</SPAN><A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2" rel="nofollow noopener noreferrer" target="_blank">http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2</A><SPAN>"></script></SPAN><BR /> <script type="text/javascript"><BR /> dojo.require("esri.map");<BR /> dojo.require("esri.tasks.find");<BR /><BR /> var find, params;<BR /> function init() {<BR /><SPAN> find = new esri.tasks.FindTask("</SPAN><A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/" rel="nofollow noopener noreferrer" target="_blank">http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/</A><SPAN>");</SPAN><BR /> params = new esri.tasks.FindParameters();<BR /> params.layerIds = [2];<BR /> params.searchFields = ["STATE_NAME","STATE_FIPS"];<BR /> }<BR /><BR /> function doFind() {<BR /> params.searchText = dojo.byId("searchText").value;<BR /> find.execute(params, showResults);<BR /> }<BR /><BR /> function showResults(results) {<BR /> var result, attribs;<BR /> var s = ["<table border=\"1\"><thead><tr style=\"background-color:#ccc;\"><td>State Name</td><td>FIPS</td><td>Population (1990)</td><td>Population (1999)</td></tr></thead><tbody id=\"states\">"];<BR /> dojo.forEach(results,function(result){<BR /> attribs = result.feature.attributes;<BR /> s.push("<tr><td>" + attribs.STATE_NAME + "</td><td>" + attribs.STATE_FIPS + "</td><td>" + attribs.POP1990 + "</td><td>" + attribs.POP1999 + "</td></tr>");<BR /> });<BR /> s.push("</tbody></table>");<BR /> dojo.byId("tbl").innerHTML = s.join("");<BR /> }<BR /><BR /> dojo.addOnLoad(init);<BR /> </script><BR /><BR /> </head><BR /> <body class="claro"><BR /> Find by State Name or State FIPS: <input type="text" id="searchText" size="40" value="Kansas" /><BR /> <input type="button" value="Find" onclick="doFind()" /><BR /><BR /> <div id="tbl"></div><BR /><BR /> </body><BR /></html><BR />
1) i have taken all layers in dropdown, when i selected particular layer its fields are displayed in listbox ,if i select any field and click the button and result should be in format of above program output. thanks in advance.