Get the dynamic dropdown value from dynamic row
<p>Is it possible using this script to get the value of dropdown for each row and put it in the textfield.
For example, after '+' button 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;/head&gt;
&lt;body&gt;
&lt;form&gt;
&lt;table&gt;
&lt;tr&gt;
  &lt;td&gt;Name:- &lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="userid" id="userid"/&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;td&gt;Gender:- &lt;/td&gt;
  &lt;td&gt;&lt;select name="select_gender" id="select_gender"&gt;
&lt;option value="M"&gt;Male&lt;/option&gt;
&lt;option value="F"&gt;Female&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;City:- &lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="city" id="city"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;    
&lt;td&gt;&lt;input type="button" id="savebtn" value="Save"/&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;div id="selected_text"&gt; 

&lt;/div&gt;
&lt;div id="selected_urls"&gt; 
&lt;a href="http://msatuniverse.net/main.aspx"&gt;E-Support &lt;/a&gt;
&lt;a href="http://ontime.mahindrasatyam.com/"&gt;Ontime &lt;/a&gt;
&lt;/div&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;table id="fmly_dtls" border=1&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;input type="text" id="member_nm"&gt;
                &lt;/td&gt; 
        &lt;td&gt;
            &lt;select id="select_member_relation" onchange=""&gt;
                &lt;option value="F"&gt;Father&lt;/option&gt;
                &lt;option value="M"&gt;Mother&lt;/option&gt;
                &lt;option value="H"&gt;Husband&lt;/option&gt;
                &lt;option value="W"&gt;Spouse&lt;/option&gt;
                &lt;option value="S"&gt;Son&lt;/option&gt;
                &lt;option value="D"&gt;Daughter&lt;/option&gt;
            &lt;/select&gt;
                &lt;/td&gt;  
        &lt;td&gt;
            &lt;input type="text" id="member_dob"&gt;
                &lt;/td&gt; 
&lt;td&gt;
            &lt;input type="button" id="madd" value="+"&gt;/&lt;input type="button" id="mdelete" 

value="-"&gt;
                &lt;/td&gt; 

         &lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;
&lt;table&gt;
&lt;tr&gt;
    &lt;td&gt;&lt;input type="button" id="finalbtn" value="Final"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

&lt;script type="text/javascript" src="jquery-1.8.3.js"&gt;&lt;/script&gt;          
 &lt;script type="text/javascript"&gt;
$(document).ready(function() {

    var windowSizeArray = ["width=200,height=200", "width=300,height=400,scrollbars=yes"];
    $("a[href]").click(function() {
        alert('Hi');

        var url = $(this).attr("href");
        var windowName = "popUp"; //$(this).attr("name"); 
        var windowSize = windowSizeArray[$(this).attr("rel")];
        alert(windowSize);
        window.open(url, windowName, windowSize);
    });

    $("#madd").click(function() {

        //.html to find out the html content data.val() is not working when selected div tag.
        if ($("#selected_text").html() != '') {
            //we need to findout particular textboxes using find function
            $(this).closest("tr").clone(true).appendTo("#fmly_dtls").find('input').val('');
        } else {
            alert('Please save the data');
        }
    });
    $("#mdelete").click(function() {


        $(this).closest("tr").remove();

    });

    $("#select_member_relation").change(function(){

        $("#fmly_dtls tr").each(function(i) {

             $("#member_nm").val($(this).find("#select_member_relation").val());
             //alert('xxx');
        });


        })
        .trigger('change');


    $("#select_member_relationxx").change(function() {
        var membrdt = '';

        $("#fmly_dtls tr").each(function(i) {

            var myValue2 = $(this).find("#select_member_relation").val()
            $("#member_nm").val($(this).find("#select_member_relation").val());

                        alert(myValue3);
            alert(myValue2);
            });
        });

    $("#finalbtn").click(function() {
        var membrdt = '';

        $("#fmly_dtls tr").each(function(i) {
            var myValue2 = $(this).find("#select_member_relation").val();
            //var myValue2 = $("#select_member_relation").val();
            alert(myValue2);
            //alert(myValue2.find('member_nm'));
        });

    });
    $("#savebtn").click(function() {
        var gender = '',
            name = '',
            gender_text = '',
            address = '';
        gender = $("#select_gender").val();
        //without option:selected attribute, it can retrived the text like Male Female
        gender_text = $("#select_gender option:selected").text();
        name = $("#userid").val();
        address = $("#city").val();
        //alert(gender+','+name+','+gender_text);
        //var _this = this; //or var $_this = this; $("#selected_text").parent().html(data); 
        var data = name + ',' + gender_text + ',' + address + '&lt;a href="http://www.google.co.in/" &gt; google&lt;/a&gt;';

        $("#selected_text").html(data);
        $("#selected_text").css('background-color', 'red');
        $("#selected_urls").hide();
        //$("#selected_text").html=data;
    });
});

&lt;/script&gt;
</code></pre>
