Load Default |
[eluser]Carlos Tafur[/eluser]
Hi, I want to know how can do this: I have a form, that load a information in combobox... I need that this information loads automatilly when i submited the form and generate a error that not valid empty fields Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I hope you understand me :-)
[eluser]vitoco[/eluser]
what you need is a HOOK http://ellislab.com/codeigniter/user-gui...hooks.html More specifically, the "display_override" Hook : Code: display_override of course, the hook runs on every load of the system, so if you wanna do the "AUTOMATICALLY" part only for that controller, you must condition it by url Saludos
[eluser]Carlos Tafur[/eluser]
[quote author="vitoco" date="1307963497"]what you need is a HOOK http://ellislab.com/codeigniter/user-gui...hooks.html More specifically, the "display_override" Hook : Code: display_override of course, the hook runs on every load of the system, so if you wanna do the "AUTOMATICALLY" part only for that controller, you must condition it by url Saludos[/quote] A example!
[eluser]Carlos Tafur[/eluser]
[quote author="noctrum" date="1307985136"]Uh... or just use set_value()[/quote] No because I need, that the select in the form charged after if generated error.
[eluser]vitoco[/eluser]
Search "display_override" in the forums, there's an example of this.
[eluser]danmontgomery[/eluser]
[quote author="Carlos Tafur" date="1308002297"][quote author="noctrum" date="1307985136"]Uh... or just use set_value()[/quote] No because I need, that the select in the form charged after if generated error.[/quote] Code: <?php echo form_dropdown('field_name', $field_options, set_value('field_name')); ?> Will give you a select field named "field_name", with the options $field_options, and if the form has been posted (form validation failed) the default value will be whatever was selected
[eluser]Carlos Tafur[/eluser]
thanks! Last question, a app with login user and permissions per page, where I found?
[eluser]Carlos Tafur[/eluser]
[quote author="noctrum" date="1308009712"][quote author="Carlos Tafur" date="1308002297"][quote author="noctrum" date="1307985136"]Uh... or just use set_value()[/quote] No because I need, that the select in the form charged after if generated error.[/quote] Code: <?php echo form_dropdown('field_name', $field_options, set_value('field_name')); ?> Will give you a select field named "field_name", with the options $field_options, and if the form has been posted (form validation failed) the default value will be whatever was selected[/quote] Last question, a app with login user and permissions per page, where I found? |
Welcome Guest, Not a member yet? Register Sign In |