请问如何通过JS实现,初步想过有这么几个问题:
1.如何获取repeater中当前行里面所有textbox 的值
2.textbox中数字改变时的事件触发如何设置
3.计算当前行所有值
请各位多多指教JavaScripttextboxC#

解决方案 »

  1.   

    1,通过DOM关系获取此行的对象
    2,onblur事件
    3,通过1得到对象后计算就行了
      

  2.   

    <tr id='48142523-8dee-49d7-8d0a-9ccee15b99bd' onclick="setId('48142523-8dee-49d7-8d0a-9ccee15b99bd')">
                                                                            <td title='惠州德联弹簧五金加工成'>
                                                                                <input type="hidden" name="repCheckSealing$ctl00$hidSupplierName" id="repCheckSealing_ctl00_hidSupplierName" value="惠州德联弹簧五金加工成" />
                                                                                <input type="hidden" name="repCheckSealing$ctl00$hidId" id="repCheckSealing_ctl00_hidId" value="48142523-8dee-49d7-8d0a-9ccee15b99bd" />
                                                                                惠州德联弹簧五金…
                                                                            </td>
                                                                            <td title='16656888898'>
                                                                                16656888898
                                                                            </td>
                                                                            <td class="td_center" title='已缴纳'>
                                                                                    <span id="repCheckSealing_ctl00_lbMargin">是</span>
                                                                            </td>
                                                                            <td title='20'>
                                                                                <input name="repCheckSealing$ctl00$txtBiddingTotel" type="text" value="20" maxlength="10" id="repCheckSealing_ctl00_txtBiddingTotel" class="ticket_right" onblur="totelChange()" style="width:80px;" />
                                                                            </td>
                                                                            <td title='20'>
                                                                                <input name="repCheckSealing$ctl00$txtClarTotal" type="text" value="20" maxlength="10" id="repCheckSealing_ctl00_txtClarTotal" class="ticket_right" style="width:80px;" />
                                                                            </td>
                                                                            <td title='afsd'>
                                                                                <input name="repCheckSealing$ctl00$txtBidderRe" type="text" value="afsd" maxlength="128" id="repCheckSealing_ctl00_txtBidderRe" style="width:150px;" />
                                                                            </td>
                                                                            <td title='qwre'>
                                                                                <input name="repCheckSealing$ctl00$txtSchedule" type="text" value="qwre" maxlength="128" id="repCheckSealing_ctl00_txtSchedule" style="width:150px;" />
                                                                            </td>
                                                                            <td title='rey'>
                                                                                <input name="repCheckSealing$ctl00$txtRe" type="text" value="rey" maxlength="256" id="repCheckSealing_ctl00_txtRe" style="width:150px;" />
                                                                            </td>
                                                                        </tr>
                                                                    
                                                                        <tr class="Line" id='c265634f-c049-4e9a-b656-a063483e7e68' onclick="setId('c265634f-c049-4e9a-b656-a063483e7e68')">
                                                                            <td title='海尔集团有限公司'>
                                                                                <input type="hidden" name="repCheckSealing$ctl01$hidSupplierName" id="repCheckSealing_ctl01_hidSupplierName" value="海尔集团有限公司" />
                                                                                <input type="hidden" name="repCheckSealing$ctl01$hidId" id="repCheckSealing_ctl01_hidId" value="c265634f-c049-4e9a-b656-a063483e7e68" />
                                                                                
                                                                                海尔集团有限公司
                                                                            </td>
                                                                            <td title='18999988232'>
                                                                                18999988232
                                                                            </td>
                                                                            <td class="td_center" title='已缴纳'>
                                                                                    <span id="repCheckSealing_ctl01_lbMargin">是</span>
                                                                            </td>
                                                                            <td title='20.50'>
                                                                                <input name="repCheckSealing$ctl01$txtBiddingTotel" type="text" value="20.50" maxlength="10" id="repCheckSealing_ctl01_txtBiddingTotel" class="ticket_right" onblur="totelChange()" style="width:80px;" />
                                                                            </td>
                                                                            <td title='20'>
                                                                                <input name="repCheckSealing$ctl01$txtClarTotal" type="text" value="20" maxlength="10" id="repCheckSealing_ctl01_txtClarTotal" class="ticket_right" style="width:80px;" />
                                                                            </td>
                                                                            <td title='yuit'>
                                                                                <input name="repCheckSealing$ctl01$txtBidderRe" type="text" value="yuit" maxlength="128" id="repCheckSealing_ctl01_txtBidderRe" style="width:150px;" />
                                                                            </td>
                                                                            <td title='oiupoy'>
                                                                                <input name="repCheckSealing$ctl01$txtSchedule" type="text" value="oiupoy" maxlength="128" id="repCheckSealing_ctl01_txtSchedule" style="width:150px;" />
                                                                            </td>
                                                                            <td title='kjgk'>
                                                                                <input name="repCheckSealing$ctl01$txtRe" type="text" value="kjgk" maxlength="256" id="repCheckSealing_ctl01_txtRe" style="width:150px;" />
                                                                            </td>
                                                                        </tr>
      

  3.   

        function totelChange(o) {
            //              td         tr
            var tr = o.parentNode.parentNode;
            var ipts = tr.getElementsByTagName('input'); //获取此行下的所有输入对象,ipts[0]对应第一个输入框,依次类推
            //计算逻辑和设置相关内容的代码
            alert(123)
        }<input name="repCheckSealing$ctl00$txtBiddingTotel" type="text" value="20" maxlength="10" id="repCheckSealing_ctl00_txtBiddingTotel" class="ticket_right" onblur="totelChange(this)" style="width:80px;" />
      

  4.   

    更正下,没注意前面还有2个隐藏的控件。。    function totelChange(o) {
            //              td         tr
            var tr = o.parentNode.parentNode;
            var ipts = tr.getElementsByTagName('input'); //获取此行下的所有输入对象,ipts[2]对应第一个输入框,依次类推
            //计算逻辑和设置相关内容的代码
        }
      

  5.   

    主要问题都已经解决了,还要问一下JS里面想要调用方法totelChange(o)需要传递什么值进去
      

  6.   

    全都解决了,非常感谢showbo 的帮助!!