Get TextBox value inside Repeater with JavaScript event Onchange

0

Good afternoon, I'm not able to pass the value of a TextBox asp.net created inside a Repeater as a parameter to a javascript function onchange function. I need to pass two parameters the first is a Eval("PostID") to which it works perfectly, but the second parameter is the value of TextBox itself can not pass it. Someone could pass a tip.

Front-end image:

<asp:RepeaterID="Repeater2" runat="server">
    <HeaderTemplate>
        <table id="repeaterTable" style="border: 1px solid black;">
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td style="border-collapse: collapse; border: 1px solid black;">
                <div class="img-push">
                    <asp:TextBox CssClass="form-control input-sm"
                        placeholder="Pressione enter para postar comentário"
                        ID="txtPost" runat="server" 
                        onchange='<%# String.Format("FunctionComment(\"{0}\", "\{1}\");", 
                        Eval("PostID"), TextBoxAQUI) %> '>
                    </asp:TextBox>                    
                </div>
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>

    
asked by anonymous 30.01.2018 / 18:44

1 answer

1

Try this:

<asp:Repeater ID="Repeater2" runat="server">
    <HeaderTemplate>
        <table id="repeaterTable" style="border: 1px solid black;">
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td style="border-collapse: collapse; border: 1px solid black;">
                <div class="img-push">
                    <asp:TextBox CssClass="form-control input-sm"
                        placeholder="Pressione enter para postar comentário"
                        ID="txtPost" runat="server" 
                        onchange='<%# String.Format("FunctionComment(\"{0}\", this.value);", 
                        Eval("PostID")) %> '>
                    </asp:TextBox>                    
                </div>
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>
    
31.01.2018 / 20:15