help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kiran83
    New Member
    • Feb 2008
    • 18

    help

    i am design a web form in asp.net with c# ,in this form some textboxes is there ,in first text box it must accept numbers but not characters , Blank spaces and special characters how to validte in client side through javascript and also cursur position should be in first textbox..
  • kushal49
    New Member
    • Feb 2008
    • 10

    #2
    I think you should use RegularExpressi onValidator for the same...
    this will also work client side.

    Comment

    • srikanth reddy
      New Member
      • Feb 2008
      • 22

      #3
      Hai Baby This Is only Possible in java script.........


      Note:- Text Box Id======== t1


      <script>
      function number()

      {

      var num=document .getElimentById ("t1").value ;


      if(num==" ")
      {
      alert(" Please Enter Number ");
      num.focus(true) ;
      num.select(true );
      }


      else if(isNaN(num))
      {
      alert("Please enter proper number ");
      num.focus(true) ;
      num.select(true );

      }

      }



      Note:-- Button Propeties ===== Onclientclick ===put ==Function name


      exaple:-- Onclientclick=n umber()

      Comment

      • kiran83
        New Member
        • Feb 2008
        • 18

        #4
        Originally posted by kushal49
        I think you should use RegularExpressi onValidator for the same...
        this will also work client side.


        please send javascript code for the above example.

        Comment

        Working...