locked
filtered textbox extender question? add numbers RRS feed

  • Question

  • User-631683198 posted

    hi,

    i am using the below but want to prevent user input of numbers as well?

    <cc1:FilteredTextBoxExtender ID="TextBox1_FilteredTextBoxExtender"
                runat="server" Enabled="True" TargetControlID="TextBox1" FilterMode="InvalidChars" FilterType="Custom" InvalidChars="~!@#$%^&*()_+[]{}|\<>/?" >
            </cc1:FilteredTextBoxExtender> the code below but want to prevent input of numbers as well ?

    Is it possible also to warn the user with a label or message popup if they try to enter invalid values>

    Monday, February 16, 2015 3:15 PM

Answers

All replies

  • User1508394307 posted

    You have the InvalidChars property where you should specify all invalid characters, in your case 0123456789. See more at https://codeforasp.wordpress.com/2009/11/11/ajax-filteredtextboxextender/ 

    In order to add an alert see example here http://forums.asp.net/t/1596429.aspx?FilteredTextBoxExtender+ 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 16, 2015 3:51 PM
  • User-631683198 posted

    thank you.   will use that

    Monday, February 16, 2015 4:21 PM
  • User-631683198 posted

    I used the solution but there it prevents another event occuring on button click?

    without this script below the page works fine but with it - another event does not work

        <script type="text/javascript">
              function pageLoad(sender, e) {
                  $find("FilteredTextBoxExtender1").add_filtered(function () {
                      $get("error").innerHTML = "Email, links and numbers not permitted";
                  });
              }
            </script>

    Tuesday, February 17, 2015 7:42 AM
  • User1508394307 posted

    Not sure if I understand it, you mean the pageLoad() in code-behind does not work?

    Try to change 

    function pageLoad(sender, e) {
    ...
    }

    to 

    $(function () {
    ...
    });

     

    Tuesday, February 17, 2015 1:33 PM