Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Numberic textbox

    hi,

    i need to create a numeric textbox control which accepts only numbers,
    decimal point, backspace, arrow keys, should not allow pasting contents...
    etc.

    i've created a web user control by extending TextBox class and added a
    javascript attribute to it as base.attributes.add("onkeydown","some
    javascript code");

    Its working when im giving the javascript code here, its not working when im
    giving javascript code in its html section...

    As there may be lots of lines in the javascript code, it should be placed
    somewhere and the function only should be called from attributes.add()
    method...


    Please provide help.
    close browser without Logout Guest

  2. Similar Questions and Discussions

    1. textbox.value
      Try this: If Textbox4.Text <> "" and Textbox5.Text <> "" and Textbox6.Text <> "" then ** TextBox4 etc are objects and not the values of the...
    2. Inserting Text before the Numberic Page numbers in paging
      How do Insert the word "Page:" in front of the auto-generated numbers in paging? For example, the bottom of the Datagrid currently just displays...
    3. textbox
      i would like modify font texybox in verdana in onpage_load textbox.font=?
    4. runat="server"....a simple html textbox or a webform server textbox...that is the question.
      I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the...
    5. VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail???
      I've had this happen a few times too. I'm still not positive of what exactly causes it but all that's happening is the control that no longer...
  3. #2

    Default Re: Numberic textbox

    > Its working when im giving the javascript code here, its not working when
    > im
    > giving javascript code in its html section...
    Probably the fault in Javascript code.
    > As there may be lots of lines in the javascript code, it should be placed
    > somewhere and the function only should be called from attributes.add()
    > method...
    How are you calling the other method from onchange (client-side)?
    Is there any Javascript error?

    The final HTML generated may look like:

    <input type='text' name='numberbox' id='numberbox' onchange='return
    checkData(this)' />
    <script language='javascript' type='text/javascript'>
    function checkData(ctrl)
    {
    var value = ctrl.value;
    // Validate the value here... and return the validation result.
    }
    </script>


    --
    Happy Hacking,
    Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    -------------------


    Gaurav Vaish \(www.EduJini.IN\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139