Welcome Guest, Not a member yet? Register   Sign In
something small, but i don't understand

I have trouble when i want to validate my form,
this is my view:

<table width=70%>
<tr >
<td colspan="3" height="50"> <h3>Tambah User</h3></td>
<tr >
<td> Username </td>
<td> : </td>
<td> &lt;?php echo form_input('username',set_value('username'),'id="search-text"'); ?&gt;
<font color="#FF0000">&lt;?php echo form_error('username','<div class="warning">','</div>'); ?&gt; </font></td>
<td> Password</td>
<td> : </td>
<td> &lt;?php echo form_input('password',set_value('password'),'id="search-text"'); ?&gt;
<font color="#FF0000">&lt;?php echo form_error('password','<div class="warning">','</div>'); ?&gt;</font></td>
<td> Jenis user</td>
<td> : </td>
<td> <select name="jenis_user">
<option value="admin">Admin</option>
<option value="pengelola_barang">Pengelola barang</option>
<option value="kepala_skpd">Kepala SKPD</option>

and this is the controller function when i submit:

function add_proses() {

$this->form_validation->set_value('username','username'.'required | min_length=[3]');
$this->form_validation->set_value('password','password'.'required | min_length=[3]');
$this->form__validation->set_message('required','data masukan tidak sesuai');
if($this->form_validation->run() == FALSE){




but the output is
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Data_user::$form__validation

Filename: controllers/data_user.php

Line Number: 52

i use ci 1.7.2.. please help me..

[eluser]Felipe Deitos[/eluser]
I am from Brazil so sorry for any english problem... i am new to CI..
Here we go... its hard to read you code, next time you should put the code inside a [ code ] tag

Can u tell us what is the line 52?

In this line:
$this->form__validation->set_message(‘required’,‘data masukan tidak sesuai’);
You have a double underscore...

In this lines:
$this->form_validation->set_value(‘username’,‘username’.‘required | min_length=[3]’);
$this->form_validation->set_value(‘password’,‘password’.‘required | min_length=[3]’);
You have a "." instead a ","

If those 2 things dont solve you problem, try to post your entire code, inside de code tags, and show us the line 52.


The problem is, as your PHP interpreter tells you, in

Message: Undefined property: Data_user::$form__validation

Now have a close look at the line that causes the problem
$this->form__validation->set_message(‘required’,‘data masukan tidak sesuai’);

and tell me what the main difference between this line and the latter is

$this->form_validation->set_message(‘required’,‘data masukan tidak sesuai’);

Theme © iAndrew 2016 - Forum software by © MyBB