Form Generation Library |
[eluser]hugle[/eluser]
Hello, the GET should go before ->valid. What I mean, you firstly should have: $data['form'] = $this->form->get(); ... ... if( $this->form->valid ) { //code } (but not wise-verse) good luck
[eluser]seanloving[/eluser]
[quote author="hugle" date="1265251766"]Hello, the GET should go before ->valid. What I mean, you firstly should have: $data['form'] = $this->form->get(); ... ... if( $this->form->valid ) { //code } (but not wise-verse) good luck[/quote] @hugle- that makes sense, but it does seem to work either way. Also, it seems like ->onsuccess( 'redirect', .. ) comes automatically before ->get(). What am I missing?
[eluser]Mat-Moo[/eluser]
I've been so busy with a project that I was unable to update to version 1... till tonight! So far I've managed to get the new version to almost everything I need, but I'm still having issues with radios groups, grrr. I required the following setup Code: <div> Code: <form> Can you help me sort these radios groups!
[eluser]Maglok[/eluser]
First define the array of options: Code: $field[] = array('1', 'Value 1'); Then add it to the form Code: ->radiogroup('fieldname', $field, 'Label:', DEFAULT_VALUE) More on this in the user_guide: http://www.frankmichel.com/formgenlib/us...group.html Be aware that it returns an array (for now) so you will need to go something like: Code: $value = $form['fieldname'][0];
[eluser]Mat-Moo[/eluser]
@Maglok, Who are you talking to? Because if that was a response to me, then I suggest you read my query again.
[eluser]Maglok[/eluser]
Oh wait you want the label on the right? There is a 'position' => 'after' default on the radiogroups in form.php (the config file). If that is not it I do not understand your query.
[eluser]Mat-Moo[/eluser]
My issue is that I can't get a DIV to surround the radio group and group label. Code: 'radio' => array(
[eluser]Maglok[/eluser]
Checkgroups and radiogroups use the 'group_prefix' and 'group_suffix' settings not field or label. That might be it. If it just has to work you can 'hardcode' it by use the html() function: Code: ->html('<div>')
[eluser]Mat-Moo[/eluser]
Thanks for you r help, but group_prefix is inserted before the first item in the group, and not the group label, e.g. Code: <label for group><group_prefix><radio><label><radio><label></group_suffix> I was trying to avoid hardcoding as I am using this in a live project with a number of forms, and was just hoping to get it to work
[eluser]macigniter[/eluser]
[quote author="Mat-Moo" date="1265831717"]Thanks for you r help, but group_prefix is inserted before the first item in the group, and not the group label, e.g. Code: <label for group><group_prefix><radio><label><radio><label></group_suffix> I was trying to avoid hardcoding as I am using this in a live project with a number of forms, and was just hoping to get it to work [/quote] Hi there, it's not a bug, it's a feature ;-) Seriously, that's the way it's supposed to work. If you would like to insert the div before and after the whole group including label you need to code it with Code: ->html('<div>') as suggested by Maglok. |
Welcome Guest, Not a member yet? Register Sign In |