<form id="formAdd" class="form-horizontal" method="post" action="user/add" onsubmit="return validasi();">
    <div class="modal-body">                           
        <div class="form-group">
            <label class="col-md-3 control-label">Nama</label>
            <div class="col-md-8">
                <input type="text" name="nama_user" class="form-control" placeholder="Nama User" required />
            </div>
        </div>                          
        <div class="form-group">
            <label class="col-md-3 control-label">Username</label>
            <div class="col-md-8">
                <input type="text" name="username" class="form-control" placeholder="Username" required />
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-3 control-label">Password</label>
            <div class="col-md-8">
                <input type="password" name="password" id="password" class="form-control" placeholder="Password" required />
            </div>
        </div>                       
        <div class="form-group">
            <label class="col-md-3 control-label">Ulangi Password</label>
            <div class="col-md-8">
                <input type="password" name="repassword" id="repassword" class="form-control" placeholder="Password" required />
            </div>
        </div>                       
        <div class="form-group">
            <label class="col-md-3 control-label">Jabatan</label>
            <div class="col-md-8">
                <input type="text" name="jabatan" class="form-control" placeholder="Jabatan" required />
            </div>
        </div>                       
        <div class="form-group">
            <label class="col-md-3 control-label">Group User</label>
            <div class="col-md-8">
                <select name="id_user_group" class="form-control" required>
                    <option value="1">User Group 1</option>
                    <option value="2">User Group 2</option>
                    <option value="3">User Group 3</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-3 control-label">Job Desk</label>
            <div class="col-md-8">
                <textarea class="form-control" name="jobdesk"></textarea>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-remove"></i> Batal</button>
        <button id="btnSubmitAdd" type="submit" class="btn btn-success"><i class="fa fa-save"></i> Simpan</button>
    </div>
</form>
  <?php $this->load->view('js') ?>
<script type="text/javascript">
    function validasi(){
        var password = document.getElementById('password').value;
        var repassword = document.getElementById('repassword').value;
        if (!(password==repassword)){
            alert('Password tidak sama!');
            return false;
        }
        }
</script>