0

I've used this plugin with an html input and it worked with no problems, however, when I try to implement using an asp.net textbox it doesn't work at all

Does someone know how can I implement it within a textbox from asp.net?

or maybe know if its possible to do so.

This is what I want to achieve using an asp.net textbox:

http://opensource.teamdf.com/number/examples/demo-as-you-type.html

Thank you so much, I really hope someone can enlighten me

UPDATE: code added.

asp.net control:

 <asp:TextBox ID="txtNumberFormat" runat="server"></asp:TextBox>

References:

<script type="text/javascript" language="javascript" src="../../js/jquery.number.js"> </script>    
<script type="text/javascript" language="javascript"src="../../js/jquery.number.min.js"></script> 

JavaScript Code:

 <script type="text/javascript">

$(function(){
    $('#txtNumberFormat.ClientID').number( true, 2 );

});

 </script>
2
  • 1
    We need to see some actual code/markup; no one wants to waste time guessing what is wrong. Commented Apr 21, 2014 at 22:36
  • Coded has been added, thank you for your suggestion. Commented Apr 21, 2014 at 22:50

1 Answer 1

2

Your jQuery is looking for a control that is literally named "txtNumberFormat.ClientID". You need

$('#<%= txtNumberFormat.ClientID %>').number( true, 2 );

so asp.net resolves the fully qualified client id inside your selector.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much Paul!, I can't believe I forgot to add that, I won't forget next time, thank you so much both for telling me to add example code and to have given me the actual solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.