Welcome Guest, Not a member yet? Register   Sign In
Form Helper: form_hidden()
#1

[eluser]Unknown[/eluser]
I am making an effort to use the helpers, in this case the "Form Helper", as much to my advantage as possible; so that my code is more easily maintained by others in the future. I have noticed that the "form_hidden()" function behaves much differently than the other functions; for an example, I will talk about "form_input()".

For form_input(), and other functions, you can use an array that controls the tag attributes (like "name", "value", and "size") with the result that all values in the array are included in the generated HTML tag.

The form_hidden() function does not act like this--the array you use only allows multiple "hidden" HTML tags to be created in one fell swoop. There is no way to attach an "id" tag attribute, that I can find.

While the ability to create "hidden" HTML tags in batches is probably beneficial, I would think that conforming to the behavior modeled by other functions would be most important; with the added functionality associated through other means. (Like an additional array parameter, for example.)

So, I solve this problem by creating my own "hidden" tag without the aid of the Form Helper. Still, I thought I would contribute to the CodeIgniter experience by suggesting a modification of the form_hidden() function.

Is this a bug fix or should I go through some other process to open a discussion?
#2

[eluser]eoinmcg[/eluser]
Quote:Is this a bug fix

no. hidden inputs have no need of size or most other attributes, hence there is no means to set them.

Quote:should I go through some other process to open a discussion?

by all means. you can replace the form_hidden() function by creating a MY_form_helper.php in application/helpers and declaring your version there. if you feel like sharing you can post it on the forum, add it to the wiki, create your own fork on bitbucket, etc.




Theme © iAndrew 2016 - Forum software by © MyBB