Welcome Guest, Not a member yet? Register   Sign In
Form Generation Library

[eluser]seanloving[/eluser]
[quote author="darnold" date="1291949177"]Mac,

Is there a way to put sections of the form in different places in the view?

[/quote]

@darnold maybe this clever hint from Mac can help you too: http://ellislab.com/forums/viewthread/10...70/#716927

Anybody know a more elegant way?

[eluser]BaRzO[/eluser]
Take a look at this one : http://thecodemine.org/#_demoForm=first

[eluser]AndrewTurner[/eluser]
Hey Everyone,

I can't seem to get the form->db working for the life of me. I can't see what's wrong. It's like it's totally skipping the model call.

Any ideas?

Model Code
<code>
function add_group(&$form, $data) {

$form_data = array(
'groupname' => $data['group_name'],
);

$this->db->insert('groups', $data);

}
</code>

Controller
<code>
function add() {
$this->load->library('form');


$this->form
->open('groups/add', 'groups_add_form')
// Basic Info
->text('group_name', 'Group Name', 'required|max_length[255]')

->submit('Submit')

->validate()

->model('groups_model', 'add_groups')

->onsuccess('redirect', array('groups/index'));


$data['form'] = $this->form->get();
$data['errors'] = $this->form->errors;
$data['main_content'] = 'group_add';

$this->load->view('template', $data);
}
</code>

Thanks!

[eluser]BaRzO[/eluser]
I think the add_groups should be add_group
Quote:->model(‘groups_model’, ‘add_groups’)

[eluser]AndrewTurner[/eluser]
[quote author="Mustafa Kahraman" date="1294073286"]I think the add_groups should be add_group
Quote:->model(‘groups_model’, ‘add_groups’)
[/quote]

I noticed that soon after posting, fixed it.

Problem is still occuring unfortunately.

I'm on CI 1.7.3, Latest FGL and also using Modular Extensions, although this model is in the root models directory

[eluser]Mat-Moo[/eluser]
You don't need validate() that's causing the issue.

[eluser]AndrewTurner[/eluser]
[quote author="Mat-Moo" date="1294073945"]You don't need validate() that's causing the issue.[/quote]

Ah ha! Houston, we no longer have an issue.

Thanks very much, Can't believe I never picked up on that one

[eluser]sahanlak[/eluser]
Why it's applying "alass" instead of "class" ?

[Image: screenshot20110105at513.png]


Code:
$this->form
                ->open('add', 'add', 'class="form"')
                ->method('post')
                ->action('gallery/add')

[eluser]macigniter[/eluser]
[quote author="sahanlak" date="1294249653"]Why it's applying "alass" instead of "class" ?[/quote]

This is a bug! You need to change the following two lines in the open() method:

Code:
if ($nameid) $this->_make_nameid($nameid, $atts);
$this->atts = $this->_make_info($atts);

must be:

Code:
$this->atts = $this->_make_info($atts);
if ($nameid) $this->_make_nameid($nameid, $this->atts);

I hope to update the library anytime soon with further fixes and updates. I have been very busy lately and didn't have that much time to support and update the library. But I am still working with it and have some updates available soon.

If anyone has found other bugs, updates or improvements please send them to me via email.

[eluser]sahanlak[/eluser]
[quote author="macigniter" date="1294670100"][quote author="sahanlak" date="1294249653"]Why it's applying "alass" instead of "class" ?[/quote]

This is a bug! You need to change the following two lines in the open() method:

Code:
if ($nameid) $this->_make_nameid($nameid, $atts);
$this->atts = $this->_make_info($atts);

must be:

Code:
$this->atts = $this->_make_info($atts);
if ($nameid) $this->_make_nameid($nameid, $this->atts);

I hope to update the library anytime soon with further fixes and updates. I have been very busy lately and didn't have that much time to support and update the library. But I am still working with it and have some updates available soon.

If anyone has found other bugs, updates or improvements please send them to me via email.[/quote]


Thanks a lot, great plugin Smile.




Theme © iAndrew 2016 - Forum software by © MyBB