Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create an alert dialog box in javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 177
    Comment on it

    An alert is a type of dialog box supported in javascript and is mostly used to give a warning message to the users.

    For example:

    1. If one input field requires to enter some text but the user does not provide any input, then as a part of validation, you can use an alert box to give a warning message.

      2.If your form get submitted successfully,then also you can use alert dialog box with some message like form submitted successfully.

      Similarly there many other examples where you can use alert diaog box.

    Have a look on this simple example to understand the concept of alert dialog box:

    <body>
    <label>Name:</label>
    <input  type="text" name="Name">
    <label>Gender:</label>
    <label>Male:</label>
    <input  type="radio" name="sex" value="Male" checked>
    <label>Female:</label>
    <input type="radio" name="sex" value="Female">
    <label >Contact:</label>
    <input itype="tel" maxlength="10" size="10">
    <button onclick="myFunction()">submit</button>
    
    <script>
    function myFunction() {
        alert("form submitted successfully");
    }
    </script>
    
    </body>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: