日期:2014-05-17  浏览次数:20355 次

如何用js获取repeater内容的值 ?
如同后台 e.item.findcontrol("id") 那样.

我的 repeater 内容有一个 textbox 和一个dropdownlist , 当dropdownlist change 的时候,我要获取同行textbox 的value 和 dropdownlist 的value . 

在前台该怎么做到呢 ? 我是js 菜鸟,希望各位能给详细的答案 ^^ 感谢!

------解决方案--------------------
你去下个jquery引用上。
<script src="jquery-1.7.js" type="text/javascript"></script>
<script src="jquery-1.7.min.js" type="text/javascript"></script>

<script>
        function ddl(e) {
            alert(e.options[e.selectedIndex].value);
            alert($(e).parent().prev().find('input').val());
            $(e).parent().next().find("input").val(e.options[e.selectedIndex].value * $(e).parent().prev().find('input').val());
            alert($(e).parent().next().find("input").val());
        }
    </script>