Welcome Guest, Not a member yet? Register   Sign In
Edit or Updating record Problem
#1

[eluser]sheru[/eluser]
Dear All,
I am learning the codeignter. I am stuck on validation run. When I edit a record it validates false and do nothing.

Code:
if ($this->validation->run() == FALSE){  <--- as this becomes false and runs the code here and as it did not execute else part so id did not update record.
    $data['message'] = '';
}else{

$childrecord= array('name' => $this->input->post('name'),
'gender' => $this->input->post('gender'),
'userfile' => $f,
'dob' => date('Y-m-d', strtotime($this->input->post('dob'))),
'descrip'=>$this->input->post('descrip'),                        
'orgname' => $this->input->post('orgname'),
'district_name' => $this->input->post('district_name'),
'dob_bs' => date('Y-m-d', strtotime($this->input->post('dob_bs'))),
'birthcert'=>$this->input->post('birthcert'),);

}
I am not able to find the problem why $this->validation->run()is FALSE during editing the record. Problem lies there. Editing field includes uploaded image file too. But while adding the record, It has no problem.

Thank you for helping me.
Sheru
#2

[eluser]tonanbarbarian[/eluser]
you will need to include the validation rules you have setup and the view file so we can see the form fields that are created
#3

[eluser]boldyellow[/eluser]
Sometimes it's easier to troubleshoot a problem if you simplify the form.

Start with just two or three fields, validate the inputs and see what's not working.
#4

[eluser]sheru[/eluser]
Dear tonanbarbarian and boldyellow,
I am sorry I became unable to post immediately, By the way, Thank you both for your valuable post and taking some time to help me. I admire you both. Many thanks.

I really don't know what caused it but as I played on set_rules, it took me on success part of $this->validation->run() but did not update the record but as I set the record id as hidden way, it really updated the record as well.

By the way, I am having problem in populating selected database value in dynamic drop-downs. I have used two tables for this drop-down values, one is children table where I store organization_id, but actually having name from partnerorg table which has prgid and partnername fields.

Your help and pointer needed.
Sheru
#5

[eluser]Pensacola1989[/eluser]
[quote author="boldyellow" date="1287989782"]Sometimes it's easier to troubleshoot a problem if you simplify the form.
??
Start with just two or three fields, validate the inputs and see what's not working.[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB