asp:Repeater min and max












1















I have a webform named Default.aspx.
Her is a repeater :



<asp:Repeater ID="repBudget" runat="server" OnItemCreated="ItemCreated">
<ItemTemplate>
<div>
<label>
<%# Eval("NameCountry") %>
</label>
<asp:TextBox ID="tbBudget" runat="server" TextMode="Number"
onKeyUp ="tbBudgetKeyPressed(this, LowValue);"
AutoPostBack = "false"
min='<%#Eval("LowValue") %>' max='<%#Eval("TopValue") %>'
pattern="^[0-9]*$" required step="1" Text='<%#Eval("Filing") %>' />
</div>
</ItemTemplate>
</asp:Repeater>


I have got a handlere performed on client's side:



function tbBudgetKeyPressed(ida, minvalue) {
alert(ida.value);
document.getElementById(ida.id).blur();
document.getElementById(ida.id).focus();
}


My question is how to pass parameters max and min



from asp:TextBox which is in repeater into tbBudgetKeyPressed. Thank you










share|improve this question





























    1















    I have a webform named Default.aspx.
    Her is a repeater :



    <asp:Repeater ID="repBudget" runat="server" OnItemCreated="ItemCreated">
    <ItemTemplate>
    <div>
    <label>
    <%# Eval("NameCountry") %>
    </label>
    <asp:TextBox ID="tbBudget" runat="server" TextMode="Number"
    onKeyUp ="tbBudgetKeyPressed(this, LowValue);"
    AutoPostBack = "false"
    min='<%#Eval("LowValue") %>' max='<%#Eval("TopValue") %>'
    pattern="^[0-9]*$" required step="1" Text='<%#Eval("Filing") %>' />
    </div>
    </ItemTemplate>
    </asp:Repeater>


    I have got a handlere performed on client's side:



    function tbBudgetKeyPressed(ida, minvalue) {
    alert(ida.value);
    document.getElementById(ida.id).blur();
    document.getElementById(ida.id).focus();
    }


    My question is how to pass parameters max and min



    from asp:TextBox which is in repeater into tbBudgetKeyPressed. Thank you










    share|improve this question



























      1












      1








      1








      I have a webform named Default.aspx.
      Her is a repeater :



      <asp:Repeater ID="repBudget" runat="server" OnItemCreated="ItemCreated">
      <ItemTemplate>
      <div>
      <label>
      <%# Eval("NameCountry") %>
      </label>
      <asp:TextBox ID="tbBudget" runat="server" TextMode="Number"
      onKeyUp ="tbBudgetKeyPressed(this, LowValue);"
      AutoPostBack = "false"
      min='<%#Eval("LowValue") %>' max='<%#Eval("TopValue") %>'
      pattern="^[0-9]*$" required step="1" Text='<%#Eval("Filing") %>' />
      </div>
      </ItemTemplate>
      </asp:Repeater>


      I have got a handlere performed on client's side:



      function tbBudgetKeyPressed(ida, minvalue) {
      alert(ida.value);
      document.getElementById(ida.id).blur();
      document.getElementById(ida.id).focus();
      }


      My question is how to pass parameters max and min



      from asp:TextBox which is in repeater into tbBudgetKeyPressed. Thank you










      share|improve this question
















      I have a webform named Default.aspx.
      Her is a repeater :



      <asp:Repeater ID="repBudget" runat="server" OnItemCreated="ItemCreated">
      <ItemTemplate>
      <div>
      <label>
      <%# Eval("NameCountry") %>
      </label>
      <asp:TextBox ID="tbBudget" runat="server" TextMode="Number"
      onKeyUp ="tbBudgetKeyPressed(this, LowValue);"
      AutoPostBack = "false"
      min='<%#Eval("LowValue") %>' max='<%#Eval("TopValue") %>'
      pattern="^[0-9]*$" required step="1" Text='<%#Eval("Filing") %>' />
      </div>
      </ItemTemplate>
      </asp:Repeater>


      I have got a handlere performed on client's side:



      function tbBudgetKeyPressed(ida, minvalue) {
      alert(ida.value);
      document.getElementById(ida.id).blur();
      document.getElementById(ida.id).focus();
      }


      My question is how to pass parameters max and min



      from asp:TextBox which is in repeater into tbBudgetKeyPressed. Thank you







      javascript asp.net






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 '18 at 12:17









      VDWWD

      24k113652




      24k113652










      asked Nov 27 '18 at 12:03









      Roman ZeleniyRoman Zeleniy

      338




      338
























          1 Answer
          1






          active

          oldest

          votes


















          2














          If you know the id, you can find the properties. I'm not sure what LowValue is in the KeyUp, so I made this example without it.



          onKeyUp="tbBudgetKeyPressed(this)"


          And then the JS



          <script type="text/javascript">
          function tbBudgetKeyPressed(ida) {
          var min = $('#' + ida.id).attr('min');
          var max = $('#' + ida.id).attr('max');
          console.log(min);
          console.log(max);
          }
          </script>


          Or if you do not use jQuery



          var min = document.getElementById(ida.id).getAttribute('min');
          var max = document.getElementById(ida.id).getAttribute('max');





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53499270%2fasprepeater-min-and-max%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            If you know the id, you can find the properties. I'm not sure what LowValue is in the KeyUp, so I made this example without it.



            onKeyUp="tbBudgetKeyPressed(this)"


            And then the JS



            <script type="text/javascript">
            function tbBudgetKeyPressed(ida) {
            var min = $('#' + ida.id).attr('min');
            var max = $('#' + ida.id).attr('max');
            console.log(min);
            console.log(max);
            }
            </script>


            Or if you do not use jQuery



            var min = document.getElementById(ida.id).getAttribute('min');
            var max = document.getElementById(ida.id).getAttribute('max');





            share|improve this answer




























              2














              If you know the id, you can find the properties. I'm not sure what LowValue is in the KeyUp, so I made this example without it.



              onKeyUp="tbBudgetKeyPressed(this)"


              And then the JS



              <script type="text/javascript">
              function tbBudgetKeyPressed(ida) {
              var min = $('#' + ida.id).attr('min');
              var max = $('#' + ida.id).attr('max');
              console.log(min);
              console.log(max);
              }
              </script>


              Or if you do not use jQuery



              var min = document.getElementById(ida.id).getAttribute('min');
              var max = document.getElementById(ida.id).getAttribute('max');





              share|improve this answer


























                2












                2








                2







                If you know the id, you can find the properties. I'm not sure what LowValue is in the KeyUp, so I made this example without it.



                onKeyUp="tbBudgetKeyPressed(this)"


                And then the JS



                <script type="text/javascript">
                function tbBudgetKeyPressed(ida) {
                var min = $('#' + ida.id).attr('min');
                var max = $('#' + ida.id).attr('max');
                console.log(min);
                console.log(max);
                }
                </script>


                Or if you do not use jQuery



                var min = document.getElementById(ida.id).getAttribute('min');
                var max = document.getElementById(ida.id).getAttribute('max');





                share|improve this answer













                If you know the id, you can find the properties. I'm not sure what LowValue is in the KeyUp, so I made this example without it.



                onKeyUp="tbBudgetKeyPressed(this)"


                And then the JS



                <script type="text/javascript">
                function tbBudgetKeyPressed(ida) {
                var min = $('#' + ida.id).attr('min');
                var max = $('#' + ida.id).attr('max');
                console.log(min);
                console.log(max);
                }
                </script>


                Or if you do not use jQuery



                var min = document.getElementById(ida.id).getAttribute('min');
                var max = document.getElementById(ida.id).getAttribute('max');






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 27 '18 at 12:17









                VDWWDVDWWD

                24k113652




                24k113652
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53499270%2fasprepeater-min-and-max%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Lallio

                    Futebolista

                    Jornalista