jQuery to copy value in select drop down to all drop down
<p>I have a form that loops over the database and displays the form to the user.  The user is supposed to change the drop down value to Add Duplicate or Move but in many cases, they will all be the same.  so, I'd like to give them a "Copy Down" feature where they can click on an icon.  This will fire a function to get the value of the selected input name (just in front of the icon in the same table cell (td) and set the other items in the list to the same value.  ID's are unique and I thought I could get use $('#id').val() to get the value but even that isn't working.</p>

<pre><code>            &lt;tr id="row_653"&gt; &lt;-- this value increments --&gt;
            &lt;td&gt;xtipi208_c_dl8453&lt;/td&gt;
            &lt;td&gt;Dalllas&lt;/td&gt;
            &lt;td&gt;ibm&lt;/td&gt;
            &lt;td&gt;SLPAR on p570&lt;/td&gt;
            &lt;td&gt;2012-04-15&lt;/td&gt;
            &lt;td&gt;dl8453&lt;/td&gt;
            &lt;td&gt;mt1933&lt;/td&gt;
            &lt;td&gt;&lt;select name="systemAction_653" id="SystemAction_653" class="systemAction"&gt;
                    &lt;option value="0"&gt;Action Required&lt;/option&gt;
                    &lt;option value="copy"&gt;Add Dup&lt;/option&gt;
                    &lt;option value="move"&gt;Move&lt;/option&gt;
                &lt;/select&gt;
                &lt;span class="ui-icon ui-icon-copy vtip replicate" id="select_resource_653" title="Copy this value down the list." style="float: right;" name="systemAction" systemid="653" cntr="13"&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
</code></pre>

<p>and here is the JS I'm working with:</p>

<pre><code>$('.replicate').live("click",function(){
    var nm=$(this).attr('name');
    var cntr=$(this).attr('cntr');
    var systemID=$(this).attr('systemID');
    var vl=$(this).parent().prev().find("select").val();

    //  alert(nm + ' ' + cntr + ' ' + systemID + ' ' + vl);  //for vl, I'm getting undefined

    $('[name="'+nm+'"][systemID="'+ systemID + '"]').each(function() {
    if ($(this).attr("cntr") &gt;= cntr) 
        $(this).parent().prev().find("select").val(vl);
      });
});
</code></pre>
