Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
fieldset form with method GET
  • Can I have fieldset with GET method not post. I tried this: $fieldset = Fieldset::forge(); $fieldset->form()->set_attribute('method', 'get');
    $fieldset->form()->add('term', '', array('type' => 'text', 'value' => $fieldset->validation()->input('term')), array('rules' => array('required')))->add_rule('required')->add_rule('trim')->add_rule('min_length', 3)->add_rule('max_length', 32);
    $fieldset->form()->add('submit', '', array('type' => 'submit', 'value' => 'Search')); // validation
    //
    if( $fieldset->validation()->run() === true )
    {
    .....
    }
    else
    {
    $this->template->view = View::forge('search', array(
    'form' => $fieldset->build(),
    'validation_error' => $fieldset->validation()->error('term')
    ), false );
    }
    Method run() has this: public function run($input = null, $allow_partial = false, $temp_callables = array())
    {
    if (empty($input) && \Input::method() != 'POST')
    {
    return false;
    } so there is no way to validate with method GET?
  • As you can see you can pass the data to the function manually: $fieldset->validation->run(\Input::get())
  • Thank you for that, it works.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion