<form id="formEdit" class="form-horizontal" method="post" action="user/update" onsubmit="return validasi();">
    <div class="modal-body">                           
        <input type="hidden" name="id_user" value="<?php echo encrypt($user->id_user); ?>" class="form-control" placeholder="NIP" required />
        <div class="form-group">
            <label class="col-md-3 control-label">Nama</label>
            <div class="col-md-8">
                <input type="text" name="nama_user" value="<?php echo $user->nama_user; ?>" class="form-control" placeholder="Nama" 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" value="<?php echo $user->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="Biarkan kosong jika tidak dirubah" />
            </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="Biarkan kosong jika tidak dirubah" />
            </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" value="<?php echo $user->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 <?php if($user->id_user_group == "1") echo "selected='selected'"; ?>  value="1">User Group 1</option>
                    <option <?php if($user->id_user_group == "2") echo "selected='selected'"; ?>  value="2">User Group 2</option>
                    <option <?php if($user->id_user_group == "2") echo "selected='selected'"; ?>  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"><?php echo nl2br($user->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="btnSubmitEdit" 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>