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:

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

 0 Comment(s)

Sign In

Sign up using

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: