Welcome Guest, Not a member yet? Register   Sign In
Form Validation Within For Loop issue

Hi Everybody. I think you  all are well.

I have been  trying to create a Block module since morning. Where i want add block and all the added block will be listed in just at the bottom of Add a New block section. Please have a look on the attached image it helps you what i am trying to say.Now the question is arise how do i apply form validation rule to add / Update block content. 

  public function block()
        $data['blocks']= $this->block_m->get();
        if($this->input->post('addblock')=='Add Block'){


            if ($this->form_validation->run() == TRUE) {
                //insert a new block
                       $data = $this->block_m->array_from_post(array('block_title','short_code','content'));
                       $this->session->set_flashdata('updatemsg',"<div class='alert alert-success'>
                       Page #".$id." Updated successfully...</div>");
        $data['main_content'] = 'webadmin/settings/block';
        $this->load->view('includes/template', $data);     


Attached Files Thumbnail(s)

It should be:

PHP Code:
if ($this->form_validation->run() == FALSE)
// show the block form
// Submitted successful  

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB