Get the dropdown value from dynamic row
<p>I found this script in internet. Is it possible using this script to get the value of dropdown for each row and put it in the textfield.</p>

<p>For example, after add row clicked, and dropdown clicked, the value of the dropdown appears in the textfield. Here is the code:  </p>

<pre><code>&lt;HTML&gt;
&lt;HEAD&gt;
    &lt;TITLE&gt; Add/Remove dynamic rows in HTML table &lt;/TITLE&gt;
    &lt;SCRIPT language="javascript"&gt;
        function addRow(tableID) {

            var table = document.getElementById(tableID);

            var rowCount = table.rows.length;
            var row = table.insertRow(rowCount);

            var colCount = table.rows[0].cells.length;

            for(var i=0; i&lt;colCount; i++) {

                var newcell = row.insertCell(i);

                newcell.innerHTML = table.rows[0].cells[i].innerHTML;
                //alert(newcell.childNodes);
                switch(newcell.childNodes[0].type) {
                    case "text":
                            newcell.childNodes[0].value = "";
                            break;
                    case "checkbox":
                            newcell.childNodes[0].checked = false;
                            break;
                    case "select-one":
                            newcell.childNodes[0].selectedIndex = 0;
                            break;
                }
            }
        }

        function deleteRow(tableID) {
            try {
            var table = document.getElementById(tableID);
            var rowCount = table.rows.length;

            for(var i=0; i&lt;rowCount; i++) {
                var row = table.rows[i];
                var chkbox = row.cells[0].childNodes[0];
                if(null != chkbox &amp;&amp; true == chkbox.checked) {
                    if(rowCount &lt;= 1) {
                        alert("Cannot delete all the rows.");
                        break;
                    }
                    table.deleteRow(i);
                    rowCount--;
                    i--;
                }


            }
            }catch(e) {
                alert(e);
            }
        }

    &lt;/SCRIPT&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;

    &lt;INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /&gt;

    &lt;INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" /&gt;

    &lt;TABLE id="dataTable" width="350px" border="1"&gt;
        &lt;TR&gt;
            &lt;TD&gt;&lt;INPUT type="checkbox" name="chk"/&gt;&lt;/TD&gt;
            &lt;TD&gt;&lt;INPUT type="text" name="txt"/&gt;&lt;/TD&gt;
            &lt;TD&gt;
                &lt;SELECT name="country"&gt;
                    &lt;OPTION value="in"&gt;India&lt;/OPTION&gt;
                    &lt;OPTION value="de"&gt;Germany&lt;/OPTION&gt;
                    &lt;OPTION value="fr"&gt;France&lt;/OPTION&gt;
                    &lt;OPTION value="us"&gt;United States&lt;/OPTION&gt;
                    &lt;OPTION value="ch"&gt;Switzerland&lt;/OPTION&gt;
                &lt;/SELECT&gt;
            &lt;/TD&gt;
        &lt;/TR&gt;
    &lt;/TABLE&gt;

&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>
