Welcome Guest, Not a member yet? Register   Sign In
Segment/passing to method problem
#4

[eluser]jcavard[/eluser]
You should avoid reserved names, such as 'Index'.
http://ellislab.com/codeigniter/user-gui...names.html

You could also have one controller to show form and to process it.

Code:
function controllerName()
{
  // check if form is submitted
  if($this->input->post('submitted') == 1)
  {
    // process form validation and everything else
    // ...
  }
  else
  {
    // load form view here
  }
}

in your form view, just add
Code:
<input type="hidden" name="submitted" value="1" />
So, when the form is posted, this value is 1, otherwise the value is undefined and you just display the view with the form (no processing yet).

hope this help!


Messages In This Thread
Segment/passing to method problem - by El Forum - 08-05-2009, 11:19 AM
Segment/passing to method problem - by El Forum - 08-05-2009, 01:03 PM
Segment/passing to method problem - by El Forum - 08-05-2009, 01:32 PM
Segment/passing to method problem - by El Forum - 08-05-2009, 01:47 PM
Segment/passing to method problem - by El Forum - 08-05-2009, 01:59 PM
Segment/passing to method problem - by El Forum - 08-05-2009, 07:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB