Form Generation Library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Form Generation Library (/showthread.php?tid=16439) |
Form Generation Library - El Forum - 05-17-2010 [eluser]hardik[/eluser] @BaRzO thanks for the library. Form Generation Library - El Forum - 05-27-2010 [eluser]seanloving[/eluser] You never need to call ->validate() because ->get() calls it automatically. is this correct? SL Form Generation Library - El Forum - 07-05-2010 [eluser]Maglok[/eluser] @poster: Correct. Question myself: I have an array like this: Code: $config['systeem'] = array( 'something' => 'Something old', Fictional values. I then use the library like so: Code: ->select('categorie', $categorieen, 'Categorie', '', 'required') Which generates this: Code: <label for="categorie" class="right required">Categorie*</label><select name="categorie[]" id="categorie"> Basically, why are the values not the ones I assigned? If I "$bericht['categorie'] = $input['categorie'][0];" then I get 0, 1 or 2 and not 'something', 'old' or 'blue'. Form Generation Library - El Forum - 07-05-2010 [eluser]macigniter[/eluser] [quote author="Maglok" date="1278336232"] Code: $config['systeem'] = array( 'something' => 'Something old', Fictional values. I then use the library like so: Code: ->select('categorie', $categorieen, 'Categorie', '', 'required') You're not assigning $config['systeem'], you're assigning $categorieen. Or is that just a typo in your example? Form Generation Library - El Forum - 07-05-2010 [eluser]Maglok[/eluser] Í forgot to list another step I do: Code: $categorieen = $this->config->item('systeem'); Since I add another option. Form Generation Library - El Forum - 07-05-2010 [eluser]BaRzO[/eluser] @macigniter nice too hear from you Is it right fix split fix Form Generation Library - El Forum - 07-05-2010 [eluser]macigniter[/eluser] [quote author="Mustafa Kahraman" date="1278338156"]@macigniter nice too hear from you Is it right fix split fix[/quote] Hi there! Is that a Form Generation Library issue or a general question for your code since split() isn't used in the latest version of the library... In certain cases you can substitue split() with explode(), but not if you use a regular expression pattern. But you're fine if you're just using it to do something like explode(';', $text); Form Generation Library - El Forum - 07-05-2010 [eluser]macigniter[/eluser] [quote author="Maglok" date="1278337729"]Í forgot to list another step I do: Code: $categorieen = $this->config->item('systeem'); Since I add another option.[/quote] I just tested this and it worked perfectly with the demo. There must be an error in your code somewhere... Form Generation Library - El Forum - 07-05-2010 [eluser]Maglok[/eluser] Alright here we go, more complete: Code: /***** I honestly tried, but it will not return the proper key value, but instead generate with 0,1,2 Form Generation Library - El Forum - 07-05-2010 [eluser]macigniter[/eluser] Looks like this is related to the sort() function which will most probably re-index your values with numeric keys... |