CodeIgniter Forums
Using "Hidden" fields on forms, a possible gotcha due to encryption - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Using "Hidden" fields on forms, a possible gotcha due to encryption (/showthread.php?tid=15243)



Using "Hidden" fields on forms, a possible gotcha due to encryption - El Forum - 01-29-2009

[eluser]TWP Marketing[/eluser]
I used "form_hidden()" to pass my record ID from an edit form and discovered that the field is actually encrypted and this resulted in my code failing to recognize it. The form_validation() test failed on the ID field when it was 'required'.

I can work around this, since the data is only visible to administration level and above, but thought it worthwhile to warn anyone else to watch out for this 'gotcha', The UserGuide does NOT mention the encryption of hidden form fields, so I will be editing my copy of UserGuide to reflect the missing information. FYI


Using "Hidden" fields on forms, a possible gotcha due to encryption - El Forum - 01-30-2009

[eluser]cwt137[/eluser]
CI does not encrypt hidden form fields. I use hidden form fields all the time to pass a record id. There is something wrong with your program. Maybe you are manipulating the variable before you put it into your form? Check that the value you think is going into the form field is correct. You can look at the html source.


Using "Hidden" fields on forms, a possible gotcha due to encryption - El Forum - 01-30-2009

[eluser]TWP Marketing[/eluser]
cwt,
You're correct, I was seeing the field content after the form had processed it and my code did specify encryption. Thanks for the reply.