• home
  • forum
  • my
  • kt
  • download
  • Text box field

    Author: 2008-08-14 08:47:19 From:

    An effective way of performing script input and output operations is through use of textbox fields. You can use textboxes, <input type="text"/>, as input areas into which users enter information, and you can use them as areas to display script output.

    Textbox Blank or not

    How to check the textbox value is blank or not


    function CheckTextboxBlank(){
    	 if(document.getElementById("textbox1").value==""){
    	    alert("Oops...blank text box");
        }else{ 
    	    alert("Good!...text box is not blank");
        }
     }
    </script>
    
      <input type="text" value="" id="textbox1" />
      <input type="button" value="check" onclick="CheckTextboxBlank();" /><br />
      

    Textbox Value is number or Text

    How to check the textbox value is Number or text


    <script>
    function CheckTextboxNumber(){
    if(!document.getElementById("textbox2").value==""){
    var obj=isNaN(document.getElementById("textbox2").value);
    if(obj){
    alert("Text");
    }else{
    alert("Number");
    }
    }
    else
    alert("please enter something...");
    }
    </script>

    <input type="text" value="" id="textbox2" />
    <input type="button" value="check" onclick="CheckTextboxNumber();" /><br />

     

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      AJAX (20)
      Content Management (8)
      Cookies (5)
      Date and Time (16)
      Development (16)
      DHTML (21)
      Forms (8)
      Frequently Asked Questions (3)
      Image Display (13)
      Introduction to Javascript (9)
      Links and Buttons (7)
      Menus (2)
      Miscellaneous (12)
      Mouse Tricks (3)
      Navigation (11)
      Randomizing (6)
      Security (5)
      Text Effects (9)
      User Authentication (2)
      User Information (5)
      Windows and Frames (6)

    New

    Hot