DHTMLX Docs & Samples Explorer

### Validation on submit

User name: Email:
Source

    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">
    <script src="../../codebase/dhtmlxcommon.js"></script>
    <script src="../../codebase/dhtmlxform.js"></script>
    <style>
    .dhxlist_obj_dhx_skyblue label{
        color:#000000;
        font-family:Tahoma;
        font-size:11px;
    }
    .dhxlist_obj_dhx_skyblue .dhxlist_txt_textarea, input.dhtmlx_validation_error{
        border: 1px solid #A4BED4;
        padding: 1px 0;
    }
    </style>

    <form action="" method="post" accept-charset="utf-8" id="my_form" onsubmit="return my_form_obj.validate();">
        <label>User name: </label><input class="dhxlist_txt_textarea" validate="NotEmpty" type="text" name="user_name" value="" />
        <label>Email: </label><input class="dhxlist_txt_textarea" validate="ValidEmail" type="text" name="user_name" value="" />
        <input type="submit" value="Send form">
    </form>
    <script>function doOnLoad() {
        my_form_obj = new dhtmlXForm("my_form");

    }</script>