Mr.AwfulAtProgramming
Mr.AwfulAtProgramming

Reputation: 73

javascript (Im assuming) dialog box customization

Where can I find the code for the dialog box? I would like to have a dialog box for the password textbox as well.

enter image description here

Upvotes: 0

Views: 20

Answers (1)

Ambrish Pathak
Ambrish Pathak

Reputation: 3968

You can get "this field is required" by using attribute "required" like:

<form name="myForm">
    <input type="password" name="psw">
</form>

if you want custom message on password field you can do so by native javascript alert like:

function validateForm() {
    var x = document.forms["myForm"]["psw"].value;
    if (x == "") {
        alert("Password is required");
        return false;
    }
}

or you can use jquery plugins to show custom message with custom styling with sweet alert

see this link for more http://t4t5.github.io/sweetalert/

Upvotes: 2

Related Questions