<html>

    <head>

        <title>Michis-ZebraForm-Beispiel</title>

        <meta charset="utf-8">

        <!-- load Zebra_Form's stylesheet file -->
        <link rel="stylesheet" href="zebra_form/css/zebra_form.css">

       

    </head>

    <body>
        <?php
            require 'zebra_form/zebra_form.php';
      
            // instantiate a Zebra_Form object
            $form = new Zebra_Form('form');
            
            // the label for the "email" field
            $form->add('label', 'label_email', 'email', 'Email');
            
            // add the "email" field
            $obj = $form->add('text', 'email', '', array('autocomplete' => 'off'));
            $obj->set_attributes(['value' => 'asdfsadfasdf']);
            // set rules
            $obj->set_rule(array(
            
                // error messages will be sent to a variable called "error", usable in custom templates
                'required'  =>  array('error', 'Email is required!'),
                'email'     =>  array('error', 'Email address seems to be invalid!'),
            
            ));
            
            // "password"
            $form->add('label', 'label_password', 'password', 'Password');
            
            $obj = $form->add('password', 'password', '', array('autocomplete' => 'off'));
            $obj->set_attributes(['value' => 'asdfsadfasdf']);
            $obj->set_rule(array(
            
                'required'  => array('error', 'Password is required!'),
                'length'    => array(6, 10, 'error', 'The password must have between 6 and 10 characters'),
            
            ));
            
            // "remember me"
            $form->add('checkbox', 'remember_me', 'yes');
            
            $form->add('label', 'label_remember_me_yes', 'remember_me_yes', 'Remember me');
            
            // "submit"
            $form->add('submit', 'btnsubmit', 'Submit');
            
            // validate the form
            if ($form->validate()) {
            
                echo "ssdf";
                
            }
            
            // auto generate output, labels above form elements
            $form->render();
        
        
        ?> 
        
    <script src="plugins/jquery-1.10.2.js"></script>
    <script src="zebra_form/zebra_form.js"></script>
    </body>

</html>