Validetta demos

Back to examples

Open an error window manually


To show error messages healthy, each field must be wrapped by an element like <div>

<div id="alert"></div>
<form id="exm" method="POST" action="#">
        <label>Required, Email :</label>
        <input type="text" name="name" data-validetta="required">
    <button type="submit">Submit</button>
    <button type="reset">Reset</button>
        // this -> form object
        // this.form is form element
        onValid : function( event ){
            event.preventDefault(); // if you dont break submit and if form doesnt have error, page will post
            var _inp = $('#exm3').find('input[name=exm3-name]').get(0);
   this, _inp, 'This is an example about how you can focus an input after completion of form validation.');